run-test-{extract|mert|misc|scorer}.perl now log the command line executed for the specific test.

This commit is contained in:
Ulrich Germann 2015-02-09 23:00:04 +00:00
parent be5799dca3
commit af9359e287
4 changed files with 22 additions and 3 deletions

View File

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

View File

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

View File

@ -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`;

View File

@ -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";