projects
/
cql-java-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[maven-release-plugin] prepare for next development iteration
[cql-java-moved-to-github.git]
/
test
/
regression
/
runtests
diff --git
a/test/regression/runtests
b/test/regression/runtests
index
f1d462b
..
1630be9
100755
(executable)
--- a/
test/regression/runtests
+++ b/
test/regression/runtests
@@
-1,10
+1,11
@@
#!/usr/bin/perl -w
#!/usr/bin/perl -w
-# $Id: runtests,v 1.7 2002-11-21 09:57:28 mike Exp $
+# $Id: runtests,v 1.12 2007-07-03 15:53:52 mike Exp $
use IO::File;
use strict;
use IO::File;
use strict;
+$ENV{CLASSPATH} .= ":../../src/main/java";
$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
if (@ARGV != 2) {
$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
if (@ARGV != 2) {
@@
-13,11
+14,12
@@
if (@ARGV != 2) {
}
my $compiler = $ARGV[0];
my $norman = $ARGV[1]; # name of XML normaliser program
}
my $compiler = $ARGV[0];
my $norman = $ARGV[1]; # name of XML normaliser program
+my($ntests, $ncorrect) = (0, 0);
while (<sections/*>) {
my $sdir = $_;
s@sections/@@;
while (<sections/*>) {
my $sdir = $_;
s@sections/@@;
- next if /^CVS$/ || /^10$/;
+ next if /^CVS$/;
print "testing section $_ - ", read_file("$sdir/name"), "\n";
while (<$sdir/*.cql>) {
print "testing section $_ - ", read_file("$sdir/name"), "\n";
while (<$sdir/*.cql>) {
@@
-27,19
+29,25
@@
while (<sections/*>) {
my $afile = $qfile;
$afile =~ s/\.cql$/.xcql/;
print " query $_ - $query ";
my $afile = $qfile;
$afile =~ s/\.cql$/.xcql/;
print " query $_ - $query ";
+ $ntests++;
my $correct = read_file("$norman < $afile |");
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";
print "OK\n";
+ $ncorrect++;
} else {
} else {
- print "\n *** different XCQL output\n";
- print "=== correct ===\n$correct";
+ print "\n *** XCQL output differs from $afile\n";
print "=== tested ===\n$tested";
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) = @_;
sub read_file {
my($name) = @_;