diff options
author | bojar <bojar@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-08-29 10:20:25 +0400 |
---|---|---|
committer | bojar <bojar@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-08-29 10:20:25 +0400 |
commit | ca1912961d698d507bb40891389664dab9c73ba6 (patch) | |
tree | f3d1180f220c35757bfd7daa5fa8e2ff4afadba0 /regression-testing | |
parent | 33ced5538a3d8504c82b61eb841d6b552f585d84 (diff) |
first draft of cruise control for Moses
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4166 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'regression-testing')
-rwxr-xr-x | regression-testing/ensure-regression-data-here.perl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/regression-testing/ensure-regression-data-here.perl b/regression-testing/ensure-regression-data-here.perl new file mode 100755 index 000000000..cc3a61390 --- /dev/null +++ b/regression-testing/ensure-regression-data-here.perl @@ -0,0 +1,34 @@ +#!/usr/bin/env perl +# downloads the regression data +use strict; +use MosesRegressionTesting; + +my $data_version = MosesRegressionTesting::TESTING_DATA_VERSION; + +exit 0 if -d "moses-reg-test-data-$data_version"; + # data in place + +safesystem("wget http://www.statmt.org/moses/reg-testing/moses-reg-test-data-$data_version.tgz") + or die "wget failed"; +safesystem("tar xzf moses-reg-test-data-$data_version.tgz") + or die "untar failed"; +safesystem("rm moses-reg-test-data-$data_version.tgz"); + +sub safesystem { + # print STDERR "Executing: @_\n"; + system(@_); + if ($? == -1) { + print STDERR "Failed to execute: @_\n $!\n"; + exit(1); + } + elsif ($? & 127) { + printf STDERR "Execution of: @_\n died with signal %d, %s coredump\n", + ($? & 127), ($? & 128) ? 'with' : 'without'; + exit(1); + } + else { + my $exitcode = $? >> 8; + print STDERR "Exit code: $exitcode\n" if $exitcode; + return ! $exitcode; + } +} |