Nail down test suite to use the CQLParser script from ../../bin
[cql-java-moved-to-github.git] / test / regression / runtests
index 32e9707..f1d462b 100755 (executable)
@@ -1,20 +1,23 @@
 #!/usr/bin/perl -w
 
-# $Id: runtests,v 1.4 2002-11-20 01:15:15 mike Exp $
+# $Id: runtests,v 1.7 2002-11-21 09:57:28 mike Exp $
 
 use IO::File;
 use strict;
 
+$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
+
 if (@ARGV != 2) {
     print STDERR "Usage: $0 <CQL-compiler> <XML-normaliser>\n";
     exit(1);
 }
 my $compiler = $ARGV[0];
-my $norman = $ARGV[1];
+my $norman = $ARGV[1];         # name of XML normaliser program
 
 while (<sections/*>) {
     my $sdir = $_;
     s@sections/@@;
+    next if /^CVS$/ || /^10$/;
     print "testing section $_ - ", read_file("$sdir/name"), "\n";
 
     while (<$sdir/*.cql>) {
@@ -23,12 +26,14 @@ while (<sections/*>) {
        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 warn "test compiler exited non-zero";
-       if ($tested ne $correct) {
-           print "    *** different XCQL output\n";
+           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";
        }