3 # $Id: runtests,v 1.7 2002-11-21 09:57:28 mike Exp $
8 $ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
11 print STDERR "Usage: $0 <CQL-compiler> <XML-normaliser>\n";
14 my $compiler = $ARGV[0];
15 my $norman = $ARGV[1]; # name of XML normaliser program
17 while (<sections/*>) {
20 next if /^CVS$/ || /^10$/;
21 print "testing section $_ - ", read_file("$sdir/name"), "\n";
23 while (<$sdir/*.cql>) {
25 s@sections/([0-9]+/.*)\.cql@$1@;
26 my $query = read_file($qfile);
28 $afile =~ s/\.cql$/.xcql/;
29 print " query $_ - $query ";
30 my $correct = read_file("$norman < $afile |");
31 my $tested = read_file("$compiler < $qfile | $norman |")
32 or print "\n *** test compiler exited non-zero\n";
33 if ($tested eq $correct) {
36 print "\n *** different XCQL output\n";
37 print "=== correct ===\n$correct";
38 print "=== tested ===\n$tested";
46 $name = "<$name" if $name !~ /\|$/;
47 my $fh = new IO::File("$name")
48 or die "can't read '$name': $!";
49 my $contents = join('', <$fh>);