From: Mike Taylor Date: Tue, 25 May 2010 14:06:12 +0000 (+0200) Subject: Count iterations and summarise results. X-Git-Tag: v1.5~6 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=f2834b0b08f014e37438f54697bf6a92f325bd23;p=cql-java-moved-to-github.git Count iterations and summarise results. --- diff --git a/test/random/mkrandom b/test/random/mkrandom index f300534..185f2c3 100755 --- a/test/random/mkrandom +++ b/test/random/mkrandom @@ -12,12 +12,17 @@ if (@ARGV > 1) { $n = $ARGV[0]; } +my $nok = 0; for (my $i = 0; $i < $n; $i++) { print $i+1, " of $n -- "; my $query=`CQLGenerator ../../etc/generate.properties`; print $query; my $canon=`CQLParser -c '$query'`; - if ($canon ne $query) { + if ($canon eq $query) { + $nok++; + } else { print "ERROR: canonicalised query differs from original\n"; } } + +print "Passed $nok/$n -- ", int(100*$nok/$n), "%\n";