2 #take the output of parseNLT.pl and load it into a database
3 # use like: cat file |perl parseNLT.pl |perl importNLT.pl password
12 $connectionInfo="dbi:mysql:$db;$host";
14 # make connection to database
15 $dbh = DBI
->connect($connectionInfo,$userid,$passwd) or die DBI
->errstr;
16 my $sth = $dbh->prepare( q{
17 INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES (?, STR_TO_DATE(?, '\%d \%M \%Y'), ?, ?)
18 }) || die "Can't prepare statement: $DBI::errstr";;
23 if (18 == scalar split " ", $d)
25 ($day, $mon, $year, $prog, $gccas, $bc, $llccompile, $llcbetacompile, $jitcompile,
26 $mc, $gcc, $cbe, $llc, $llcbeta, $jit, $foo1, $foo2, $foo3) = split " ", $d;
29 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
30 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'gccas', $gccas)") || die DBI->errstr;
34 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
35 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'bytecode', $bc)") || die DBI->errstr;
37 if ($llccompile =~ /\d/)
39 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
40 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-compile', $llccompile)") || die DBI->errstr;
42 if ($llcbetacompile =~ /\d/)
44 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
45 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-beta-compile', $llcbetacompile)") || die DBI->errstr;
47 if ($jitcompile =~ /\d/)
49 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
50 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'jit-compile', $jitcompile)") || die DBI->errstr;
54 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
55 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'machine-code', $mc)") || die DBI->errstr;
59 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
60 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'gcc', $gcc)") || die DBI->errstr;
64 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
65 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc', $llc)") || die DBI->errstr;
69 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
70 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-beta', $llcbeta)") || die DBI->errstr;
74 $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
75 ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'jit', $jit)") || die DBI->errstr;
85 # disconnect from database