3 # $Id: runtests,v 1.4 2002-11-20 01:15:15 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 print "testing section $_ - ", read_file("$sdir/name"), "\n";
20 while (<$sdir/*.cql>) {
22 s@sections/([0-9]+/.*)\.cql@$1@;
23 my $query = read_file($qfile);
25 $afile =~ s/\.cql$/.xcql/;
26 print " query $_ - $query\n";
27 my $correct = read_file("$norman < $afile |");
28 my $tested = read_file("$compiler < $qfile | $norman |")
29 or warn "test compiler exited non-zero";
30 if ($tested ne $correct) {
31 print " *** different XCQL output\n";
32 print "=== correct ===\n$correct";
33 print "=== tested ===\n$tested";
41 $name = "<$name" if $name !~ /\|$/;
42 my $fh = new IO::File("$name")
43 or die "can't read '$name': $!";
44 my $contents = join('', <$fh>);