#!/usr/bin/perl -w
-# $Id: runtests,v 1.2 2002-11-03 17:02:48 mike Exp $
+# $Id: runtests,v 1.6 2002-11-20 23:10:17 mike Exp $
use IO::File;
use strict;
while (<sections/*>) {
my $sdir = $_;
s@sections/@@;
+ next if /^CVS$/ || /^10$/;
print "testing section $_ - ", read_file("$sdir/name"), "\n";
while (<$sdir/*.cql>) {
my $query = read_file($qfile);
my $afile = $qfile;
$afile =~ s/\.cql$/.xcql/;
- print " query $_ - $query\n";
+ print " query $_ - $query ";
my $correct = read_file("$norman < $afile |");
my $tested = read_file("$compiler < $qfile | $norman |")
- or die "can't run test compiler '$compiler | $norman': $!";
- print " *** different XCQL output\n"
- if $tested ne $correct;
+ or print "\n *** test compiler exited non-zero\n";
+ if ($tested eq $correct) {
+ print "OK\n";
+ } else {
+ print "\n *** different XCQL output\n";
+ print "=== correct ===\n$correct";
+ print "=== tested ===\n$tested";
+ }
}
}