X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fregression%2Fruntests;h=070a9215fd40af18a5ce49f657d6eebd34876b60;hb=5ec1bd19b223ae4980d46c737bb20af68ef17e8f;hp=f1d462b5da18e2a8924f28a3c88652dd7d143e85;hpb=793974224b44b400cdbf02303d3b54d3e1f20248;p=cql-java-moved-to-github.git diff --git a/test/regression/runtests b/test/regression/runtests index f1d462b..070a921 100755 --- a/test/regression/runtests +++ b/test/regression/runtests @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# $Id: runtests,v 1.7 2002-11-21 09:57:28 mike Exp $ +# $Id: runtests,v 1.10 2007-06-21 14:54:32 mike Exp $ use IO::File; use strict; @@ -13,6 +13,7 @@ if (@ARGV != 2) { } my $compiler = $ARGV[0]; my $norman = $ARGV[1]; # name of XML normaliser program +my($ntests, $ncorrect) = (0, 0); while () { my $sdir = $_; @@ -27,19 +28,26 @@ while () { my $afile = $qfile; $afile =~ s/\.cql$/.xcql/; print " query $_ - $query "; + $ntests++; my $correct = read_file("$norman < $afile |"); - my $tested = read_file("$compiler < $qfile | $norman |") - or print "\n *** test compiler exited non-zero\n"; - if ($tested eq $correct) { + my $tested = read_file("$compiler < $qfile | $norman |"); + if (!$tested) { + print "\n *** test compiler exited non-zero\n"; + } elsif ($tested eq $correct) { print "OK\n"; + $ncorrect++; } else { print "\n *** different XCQL output\n"; print "=== correct ===\n$correct"; print "=== tested ===\n$tested"; + print "=== end ===\n"; } } } +print sprintf("%d of %d passed: %d%%\n", + $ncorrect, $ntests, (100 * $ncorrect) / $ntests); + sub read_file { my($name) = @_;