summaryrefslogtreecommitdiff
path: root/lib/sbin/RunTest.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-04-13 21:59:19 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-04-13 21:59:19 +0000
commit0c169eb0f6519cb133618dedf5a856cfae6c2693 (patch)
tree9f462e9b55a212211328b44a3f1023d705f0855e /lib/sbin/RunTest.pl
parentcff6bb76c73617ce117c95b05e5e037d098bb40e (diff)
Somewhat tidied up version of Runtest for doing testsuite checking. This
is in preparation for getting together a complete spec for and doing it properly. A lot of the internals have been changed around, so in case of problems I've left the original version there for the moment, to run the original version just edit Makefile and replace RunTest.pl with Runtest.pl The main differences though should be - a lot more output at the end, probably too much, would welcome any ideas on what information to display and how - better menu interface for choosing a test to run, also started adding a couple of other features. Hopefully removed all the infinite loops from the menu. - now works properly when a test with the same name is in two different thorns ... note that this meant adding an extra layer of directories in the TEST directory so if anyone uses a path to the output files in the TEST directories (like in the testsuites for IOHDF5/IOFlexIO) these will need to be changed. Should now be able to go on to fix outstanding requests in gnats for the testsuites. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2712 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/RunTest.pl')
-rw-r--r--lib/sbin/RunTest.pl161
1 files changed, 161 insertions, 0 deletions
diff --git a/lib/sbin/RunTest.pl b/lib/sbin/RunTest.pl
new file mode 100644
index 00000000..d936672d
--- /dev/null
+++ b/lib/sbin/RunTest.pl
@@ -0,0 +1,161 @@
+#!/bin/perl -s
+#
+# Test Suite tool
+# Version: $Header$
+
+require "lib/sbin/RunTestUtils.pl";
+
+$prompt = shift;
+$prompt =~ tr/A-Z/a-z/;
+
+$config = shift;;
+
+# Set up RunTest configuration
+%config_data = &Configure($config);
+$sep= "/";
+
+&PrintHeader;
+
+# Look to see if MPI is dfined
+$mpi = ParseExtras(%config_data);
+
+# Get the executable
+$executable = ParseExecutable(%config_data);
+
+if ($mpi)
+{
+ $numprocs = &defprompt(" Enter number of processors","2");
+ $command = &defprompt(" Enter command to run executable","mpirun -np $numprocs ");
+}
+else
+{
+ $command = &defprompt(" Enter command to run executable"," ");
+}
+
+# Initialise testdata database
+%testdata = &InitialiseTestData();
+
+# Find test parameter files
+%testdata = &ParseTests(%config_data);
+
+# Parse test parameter files
+%testdata = &ParseAllParameterFiles(%testdata);
+
+# Reset/Initialise Test Statistics
+%testdata = &ResetTestStatistics(%testdata);
+
+# Print database
+#&PrintDataBase(%testdata);
+$loop = 1;
+$run = 1;
+
+$tests = &defprompt(" Run All tests or go to Menu","All");
+
+while ($loop == 1)
+{
+ if ($tests =~ /^A/i)
+ {
+ # Run all parameter files
+ foreach $thorn (split(" ",$testdata{"RUNNABLETHORNS"}))
+ {
+ foreach $test (split(" ",$testdata{"$thorn RUNNABLE"}))
+ {
+ print " Test $thorn: $test \n";
+ print " \"$testdata{\"$thorn $test DESC\"}\"\n";
+ if ($run)
+ {
+ %testdata = &RunTest($test,$thorn,%testdata);
+ }
+ %testdata = &CompareTestFiles($test,$thorn,%testdata);
+ }
+ }
+
+ # Write results of all tests
+ &WriteFullResults(%testdata);
+
+ $loop = 0;
+ }
+ elsif ($tests =~ /^M/i)
+ {
+ undef($thorn);
+ undef($test);
+ undef($choice);
+
+ while (!($choice =~ /^[EOQ]/i) )
+ {
+
+ print "\n --- Menu ---\n\n";
+
+ print " Choose test from [T]horn or [A]rrangement\n";
+ print " Rerun previous test [R]\n";
+ print " Run entire set of tests [E]\n";
+ print " Compare all files in the test output directories [O]\n";
+ print " Customize testsuite checking [C]\n";
+ print " Quit [Q]\n\n";
+ $choice = &defprompt(" Select choice: ","T");
+
+ if ($choice =~ /^[ATC]/i)
+ {
+ ($test,$thorn) = &ChooseTest($choice,%testdata);
+ %testdata = &RunTest($test,$thorn,%testdata);
+ %testdata = &CompareTestFiles($test,$thorn,%testdata);
+ }
+ elsif ($choice =~ /^R/i)
+ {
+ if ($thorn && $test)
+ {
+ print " Running $thorn: $test \n";
+ print " \"$testdata{\"$thorn $test DESC\"}\"\n";
+ %testdata = &RunTest($test,$thorn,%testdata);
+ %testdata = &CompareTestFiles($test,$thorn,%testdata);
+ }
+ else
+ {
+ print " No previous test has been run\n";
+ }
+ }
+ elsif ($choice =~ /^C/i)
+ {
+ print " Options for customization\n";
+ if ($test)
+ {
+ print " Change tolerance for this run ($test) [R]\n";
+ }
+ print " Change tolerance from $testdata{\"TOLERANCE\"} for all further runs [T]\n";
+ $choice = &defprompt(" Select choice: ","");
+ if ($choice =~ /T/i)
+ {
+ $testdata{"TOLERANCE"} = &defprompt(" New tolerance: ","$testdata{\"TOLERANCE\"}");
+ }
+ }
+ elsif ($choice =~ /^Q/i)
+ {
+ $loop = 0;
+ }
+ elsif ($choice =~ /^E/i)
+ {
+ $tests = "A";
+ }
+ elsif ($choice =~ /^O/i)
+ {
+ $tests = "A";
+ $run = 0;
+ }
+ else
+ {
+ print " Choice not recognized, try again!\n";
+ }
+ }
+ }
+ elsif ($tests =~ /^Q/i)
+ {
+ $loop = 0;
+ }
+ else
+ {
+ print " Choice not recognized, try again!\n";
+ }
+
+ print "\n";
+}
+