Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tesh now reports if the outputs were sorted on mismatch
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 25 Jul 2015 17:27:59 +0000 (19:27 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 25 Jul 2015 17:27:59 +0000 (19:27 +0200)
tools/tesh/tesh.pl

index 9f218e9..4ae67a0 100755 (executable)
@@ -341,7 +341,7 @@ sub parse_out {
       shift @got;
     }
 
-    #also resort the other one, as perl sort is not the same as the C one used to generate teshes
+    # Sort the expected output to make it easier to write for humans
     if(defined($cmd{'out'})){
       @{$cmd{'out'}}=sort mysort @{$cmd{'out'}};
       while (@{$cmd{'out'}} and ${$cmd{'out'}}[0] eq "") {
@@ -396,6 +396,9 @@ sub parse_out {
   }
   if (length $diff) {
     print "Output of <$cmd{'file'}:$cmd{'line'}> mismatch:\n";
+    if ($cmd{'sort'}) {
+       print "WARNING: both the observed output and expected output were sorted as requested\n";
+    }
     map { print "$_\n" } split(/\n/,$diff);
 
     print "Test suite `$cmd{'file'}': NOK (<$cmd{'file'}:$cmd{'line'}> output mismatch)\n";