3 # $Id: runtests,v 1.6 2002-11-20 23:10:17 mike Exp $
9 print STDERR "Usage: $0 <CQL-compiler> <XML-normaliser>\n";
12 my $compiler = $ARGV[0];
13 my $norman = $ARGV[1];
15 while (<sections/*>) {
18 next if /^CVS$/ || /^10$/;
19 print "testing section $_ - ", read_file("$sdir/name"), "\n";
21 while (<$sdir/*.cql>) {
23 s@sections/([0-9]+/.*)\.cql@$1@;
24 my $query = read_file($qfile);
26 $afile =~ s/\.cql$/.xcql/;
27 print " query $_ - $query ";
28 my $correct = read_file("$norman < $afile |");
29 my $tested = read_file("$compiler < $qfile | $norman |")
30 or print "\n *** test compiler exited non-zero\n";
31 if ($tested eq $correct) {
34 print "\n *** different XCQL output\n";
35 print "=== correct ===\n$correct";
36 print "=== tested ===\n$tested";
44 $name = "<$name" if $name !~ /\|$/;
45 my $fh = new IO::File("$name")
46 or die "can't read '$name': $!";
47 my $contents = join('', <$fh>);