diff options
author | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2014-04-11 21:32:28 +0400 |
---|---|---|
committer | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2014-04-11 21:32:28 +0400 |
commit | edf6ea4fc244d346a1c4c98bf67e9ee7abb71406 (patch) | |
tree | 8c6b4178b6a80ec495202c747180b42298fe75c2 /regression-testing | |
parent | 24545ba1de0cf24ef1177863f31e53ceb273610a (diff) |
run-single-test.perl now logs the command line in the test, to facilitate debugging when tests fail.
Diffstat (limited to 'regression-testing')
-rwxr-xr-x | regression-testing/run-single-test.perl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/regression-testing/run-single-test.perl b/regression-testing/run-single-test.perl index 48fcb5891..232c2392d 100755 --- a/regression-testing/run-single-test.perl +++ b/regression-testing/run-single-test.perl @@ -119,14 +119,21 @@ sub exec_moses { my ($decoder, $conf, $input, $results) = @_; my $start_time = time; my ($o, $ec, $sig); + my $cmd; if ($NBEST > 0){ print STDERR "Nbest output file is $results/run.nbest\n"; print STDERR "Nbest size is $NBEST\n"; - ($o, $ec, $sig) = run_command("$decoder -f $conf -i $input -n-best-list $results/run.nbest $NBEST 1> $results/run.stdout 2> $results/run.stderr"); + $cmd = "$decoder -f $conf -i $input -n-best-list $results/run.nbest $NBEST 1> $results/run.stdout 2> $results/run.stderr"; } else{ - ($o, $ec, $sig) = run_command("$decoder -f $conf -i $input 1> $results/run.stdout 2> $results/run.stderr"); + $cmd = "$decoder -f $conf -i $input 1> $results/run.stdout 2> $results/run.stderr"; } + + open CMD, ">$results/cmd_line"; + print CMD "$cmd\n"; + close CMD; + + ($o, $ec, $sig) = run_command($cmd); my $elapsed = time - $start_time; return ($o, $elapsed, $ec, $sig); } |