mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 21:03:22 +03:00
run-test-{extract|mert|misc|scorer}.perl now log the command line executed for the specific test.
This commit is contained in:
parent
be5799dca3
commit
af9359e287
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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`;
|
||||
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user