diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-04-26 20:21:19 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-04-26 20:21:19 +0400 |
commit | 87c3becbf6fbeae60aa060148b896611ab74d888 (patch) | |
tree | 90af51e6d9aa055c9e04b2696c260ce84d6a2ec4 /regression-testing | |
parent | d5a0eb2423d9945833f582e30070215a8b05df5b (diff) |
regression
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3206 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'regression-testing')
-rwxr-xr-x | regression-testing/run-test-suite.pl | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/regression-testing/run-test-suite.pl b/regression-testing/run-test-suite.pl index 6369ac955..3bbc4a647 100755 --- a/regression-testing/run-test-suite.pl +++ b/regression-testing/run-test-suite.pl @@ -8,20 +8,20 @@ use Getopt::Long; ############################################################ my @tests = qw ( - basic-surface-only - ptable-filtering - multi-factor - multi-factor-drop - confusionNet-surface-only - confusionNet-multi-factor - basic-surface-binptable - multi-factor-binptable - nbest-multi-factor - lattice-surface - lattice-distortion - lexicalized-reordering - lexicalized-reordering-cn - consensus-decoding-surface + phrase.basic-surface-only + phrase.ptable-filtering + phrase.multi-factor + phrase.multi-factor-drop + phrase.confusionNet-surface-only + phrase.confusionNet-multi-factor + phrase.basic-surface-binptable + phrase.multi-factor-binptable + phrase.nbest-multi-factor + phrase.lattice-surface + phrase.lattice-distortion + phrase.lexicalized-reordering + phrase.lexicalized-reordering-cn + phrase.consensus-decoding-surface ); # xml-markup @@ -30,13 +30,15 @@ use MosesRegressionTesting; use File::Temp qw ( tempfile ); use POSIX qw ( strftime ); -my $decoder; +my $decoderPhrase; +my $decoderChart; my $test_dir; my $BIN_TEST = $script_dir; my $data_dir; -GetOptions("decoder=s" => \$decoder, - "data-dir=s" => \$data_dir, +GetOptions( "decoder-phrase=s" => \$decoderPhrase, + "decoder-chart=s" => \$decoderChart, + "data-dir=s" => \$data_dir, ) or exit 1; $data_dir = MosesRegressionTesting::find_data_directory($BIN_TEST, $data_dir); @@ -47,11 +49,9 @@ $test_run .= " --test-dir=$test_dir" if $test_dir; print "Data directory: $data_dir\n"; -die "Please specify a decoder to test with --decoder\n" unless $decoder; +die "Please specify the phrase-base & chart decoder to test with --decoder-phrase=[path] --decoder-chart=[path] \n" unless ($decoderPhrase and $decoderChart); -die "Cannot locate executable called $decoder\n" unless (-x $decoder); - -$test_run .= " --decoder=$decoder"; +die "Cannot locate executable called $decoderPhrase\n" unless (-x $decoderPhrase); print "Running tests: @tests\n\n"; @@ -61,8 +61,25 @@ print $lb; my $fail = 0; my @failed; -foreach my $test (@tests) { - my $cmd = "$test_run --test=$test"; +foreach my $test (@tests) +{ + my $cmd; + my $model_type = substr($test, $[, 6); + + if ($model_type eq 'phrase') + { + $cmd .= "$test_run --decoder=$decoderPhrase"; + } + elsif ($model_type eq 'chart.') + { + $cmd .= "$test_run --decoder=$decoderChart"; + } + else + { + print "FAIL"; + } + + $cmd .= " --test=$test"; my ($res, $output, $results_path) = do_test($cmd); format STDOUT = @<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |