[Octopus-devel] [Patch] Test suite: Improve generated matches.sh

Tobias Burnus tobias.burnus at physik.fu-berlin.de
Thu Jul 26 15:24:47 WEST 2007


Hi,

there were two things which I disliked about ./matches.sh:
a) The printed regular expression misses the backslashes ("\s" is
printed as "s")
b) One cannot quickly see whether a result passes or not.

I propose the following patch which then prints:

============================================================[ Force -
pre command ]
   1        Na       0.000037      -0.000000      -0.000000
------------------------------------------------------------[ Force -
regular expression ]
\s*0.0000\d*\s*0.0000\d*\s*0.0000\d*
Match: FAILED


Tobias


Index: testsuite/oct-run_regression_test.pl
===================================================================
--- testsuite/oct-run_regression_test.pl        (Revision 3102)
+++ testsuite/oct-run_regression_test.pl        (Arbeitskopie)
@@ -328,7 +328,10 @@
      print SCRIPT "echo ", "="x60, "[ $name - pre command ] \n";
      print SCRIPT "$pre_command\n";
      print SCRIPT "echo ", "-"x60, "[ $name - regular expression ] \n";
-     print SCRIPT "echo $regexp\n";
+     print SCRIPT "echo '$regexp'\n";
+     print SCRIPT "export LINE=`$pre_command`\n";
+     print SCRIPT 'perl -e \'print "Match: ".($ENV{LINE} =~ m/'.$regexp
+                 .'/?"OK":"FAILED")."\n"\''."\n";
      print SCRIPT "echo;echo\n";
      close(SCRIPT);





More information about the Octopus-devel mailing list