diff options
author | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2011-09-26 14:27:08 +0000 |
---|---|---|
committer | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2011-09-26 14:27:08 +0000 |
commit | c546f6ff7f205d1a5be2f5b1c4f98f839cf700b8 (patch) | |
tree | 79842f94c440b5b2825df2187312ab34353965fb /lib | |
parent | 19735443de8b118a28fae31e00876aef014d423c (diff) |
only try to read test.ccl when it exists
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4735 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbin/RunTestUtils.pl | 68 |
1 files changed, 33 insertions, 35 deletions
diff --git a/lib/sbin/RunTestUtils.pl b/lib/sbin/RunTestUtils.pl index a3b3adac..1cef0b03 100644 --- a/lib/sbin/RunTestUtils.pl +++ b/lib/sbin/RunTestUtils.pl @@ -162,44 +162,42 @@ sub ParseTestConfigs print " Thorn $thorn has a 'config' file in 'test/'.\n". " Config files are deprecated. Use test.ccl instead.\n"; } - if (!-r $config_file) + if (-r $config_file) { - $config_file = ''; - } - - my @config = &read_file($config_file); - for($line_number = 0; $line_number < @config; $line_number++) - { - $line = $config[$line_number]; - - # Parse tokens - if ($line =~ m/^\s*ABSTOL\s*(.*)/i) + my @config = &read_file($config_file); + for($line_number = 0; $line_number < @config; $line_number++) { + $line = $config[$line_number]; + + # Parse tokens + if ($line =~ m/^\s*ABSTOL\s*(.*)/i) + { $ABSTOL = $rundata->{"$thorn ABSTOL"}=$1; - } - elsif ($line =~ m/^\s*RELTOL\s*(.*)/i) - { - $RELTOL = $rundata->{"$thorn RELTOL"}=$1; - } - elsif ($line =~ m/^\s*NPROCS\s+(\d+)\s*$/i) - { - $NPROCS = $rundata->{"$thorn NPROCS"} = $1; - } - elsif ($line =~ m/^\s*EXTENSIONS\s*(.*)/i) - { - $testdata->{"EXTENSIONS"} .= "$1 "; - } - elsif ($line =~ m/^\s*TEST\s*(.*)/i) - { - ($test, $ABSTOL, $RELTOL, $NPROCS, $line_number) = - &ParseTestBlock($line_number, \@config); - $rundata->{"$thorn $test ABSTOL"} = $ABSTOL; - $rundata->{"$thorn $test RELTOL"} = $RELTOL; - $rundata->{"$thorn $test NPROCS"} = $NPROCS; - } - else - { - print " Unrecognised token $line in config file for thorn $thorn\n"; + } + elsif ($line =~ m/^\s*RELTOL\s*(.*)/i) + { + $RELTOL = $rundata->{"$thorn RELTOL"}=$1; + } + elsif ($line =~ m/^\s*NPROCS\s+(\d+)\s*$/i) + { + $NPROCS = $rundata->{"$thorn NPROCS"} = $1; + } + elsif ($line =~ m/^\s*EXTENSIONS\s*(.*)/i) + { + $testdata->{"EXTENSIONS"} .= "$1 "; + } + elsif ($line =~ m/^\s*TEST\s*(.*)/i) + { + ($test, $ABSTOL, $RELTOL, $NPROCS, $line_number) = + &ParseTestBlock($line_number, \@config); + $rundata->{"$thorn $test ABSTOL"} = $ABSTOL; + $rundata->{"$thorn $test RELTOL"} = $RELTOL; + $rundata->{"$thorn $test NPROCS"} = $NPROCS; + } + else + { + print " Unrecognised token $line in config file for thorn $thorn\n"; + } } } } |