diff options
author | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-02-10 02:00:04 +0300 |
---|---|---|
committer | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-02-10 02:00:04 +0300 |
commit | af9359e287f86d370da556d1279eb9d741b03ce8 (patch) | |
tree | 30d66cca681056df021aca47c42d260faaa62d27 /regression-testing | |
parent | be5799dca34027849fc40a38a63459e164f27add (diff) |
run-test-{extract|mert|misc|scorer}.perl now log the command line executed for the specific test.
Diffstat (limited to 'regression-testing')
-rwxr-xr-x | regression-testing/run-test-extract.perl | 7 | ||||
-rwxr-xr-x | regression-testing/run-test-mert.perl | 6 | ||||
-rwxr-xr-x | regression-testing/run-test-misc.perl | 7 | ||||
-rwxr-xr-x | regression-testing/run-test-scorer.perl | 5 |
4 files changed, 22 insertions, 3 deletions
diff --git a/regression-testing/run-test-extract.perl b/regression-testing/run-test-extract.perl index d13ef62d6..bc0dc0cf9 100755 --- a/regression-testing/run-test-extract.perl +++ b/regression-testing/run-test-extract.perl @@ -46,6 +46,11 @@ s/(\$\w+)/$1/eeg; $extractorArgs = $_; my $cmdMain = "$extractorExe $extractorArgs \n"; + +open CMD, ">$results_dir/cmd_line"; +print CMD "$cmdMain"; +close CMD; + `$cmdMain`; my $truthPath = "$test_dir/$test_name/truth/"; @@ -53,7 +58,7 @@ my $truthPath = "$test_dir/$test_name/truth/"; if (-e $outPath) { - my $cmd = "diff --exclude=.DS_Store --exclude=._* $outPath/ $truthPath/ | wc -l"; + my $cmd = "diff --exclude=.DS_Store --exclude=._* --exclude=cmd_line $outPath/ $truthPath/ | wc -l"; my $numDiff = `$cmd`; if ($numDiff == 0) diff --git a/regression-testing/run-test-mert.perl b/regression-testing/run-test-mert.perl index e22d152df..233e08b44 100755 --- a/regression-testing/run-test-mert.perl +++ b/regression-testing/run-test-mert.perl @@ -92,7 +92,11 @@ exit 0; sub exec_test { my ($test_dir,$results) = @_; my $start_time = time; - my ($o, $ec, $sig) = run_command("sh $test_dir/command $bin_dir $test_dir 1> $results/run.stdout 2> $results/run.stderr"); + my $cmd = "sh $test_dir/command $bin_dir $test_dir 1> $results/run.stdout 2> $results/run.stderr"; + open CMD, ">$results/cmd_line"; + print CMD "$cmd"; + close CMD; + my ($o, $ec, $sig) = run_command($cmd); my $elapsed = 0; $elapsed = time - $start_time; return ($o, $elapsed, $ec, $sig); diff --git a/regression-testing/run-test-misc.perl b/regression-testing/run-test-misc.perl index 7a444f8c3..da79c94e8 100755 --- a/regression-testing/run-test-misc.perl +++ b/regression-testing/run-test-misc.perl @@ -38,6 +38,11 @@ unless (defined $results_dir) use File::Basename qw/dirname/; my $dir = dirname ($0); my $cmdMain = "perl -I $dir $test_dir/$test_name/run.perl -moses-root $mosesRoot -moses-bin $mosesBin -test $test_name -data-dir $data_dir -test-dir $test_dir -results-dir $results_dir\n"; + +open CMD, ">$results_dir/cmd_line"; +print CMD $cmdMain; +close CMD; + `$cmdMain`; my $outPath = "$results_dir/out"; @@ -47,7 +52,7 @@ print STDERR "outPath=$outPath \n truthPath=$truthPath \n"; if (-e $outPath) { - my $cmd = "diff $outPath $truthPath | wc -l"; + my $cmd = "diff --exclude=cmd_line $outPath $truthPath | wc -l"; my $numDiff = `$cmd`; diff --git a/regression-testing/run-test-scorer.perl b/regression-testing/run-test-scorer.perl index 22a7b9370..6bd95ad55 100755 --- a/regression-testing/run-test-scorer.perl +++ b/regression-testing/run-test-scorer.perl @@ -46,6 +46,11 @@ s/(\$\w+)/$1/eeg; $scorerArgs = $_; my $cmdMain = "$scoreExe $scorerArgs \n"; + +open CMD, ">$results_dir/cmd_line"; +print CMD "$cmdMain"; +close CMD; + `$cmdMain`; my $truthPath = "$test_dir/$test_name/truth/results.txt"; |