run-single-test.perl now logs the command line in the test, to facilitate debugging when tests fail.

This commit is contained in:
Ulrich Germann 2014-04-11 18:32:28 +01:00
parent 24545ba1de
commit edf6ea4fc2

View File

@ -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);
}