2012-09-11 13:43:28 +04:00
|
|
|
import option path ;
|
2011-11-28 19:52:53 +04:00
|
|
|
|
|
|
|
with-regtest = [ option.get "with-regtest" ] ;
|
2012-09-11 13:43:28 +04:00
|
|
|
|
2011-11-28 19:52:53 +04:00
|
|
|
if $(with-regtest) {
|
2012-09-11 13:43:28 +04:00
|
|
|
with-regtest = [ path.root $(with-regtest) [ path.pwd ] ] ;
|
|
|
|
} else if [ option.get "with-regtest" : : "yes" ] {
|
|
|
|
shell_or_fail "git submodule init" ;
|
|
|
|
shell_or_fail "git submodule update" ;
|
|
|
|
with-regtest = $(TOP)/regression-testing/tests ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if $(with-regtest) {
|
|
|
|
test-dir = $(with-regtest)/tests ;
|
|
|
|
|
2012-10-04 19:08:37 +04:00
|
|
|
rule reg_test ( name : tests * : programs * : action ) {
|
2011-11-28 19:52:53 +04:00
|
|
|
alias $(name) : $(tests:D=).passed ;
|
|
|
|
for test in $(tests) {
|
2012-10-04 19:08:37 +04:00
|
|
|
make $(test:D=).passed : $(programs) : $(action) ;
|
2011-11-28 20:01:45 +04:00
|
|
|
alias $(test) : $(test:D=).passed ;
|
2011-11-28 19:52:53 +04:00
|
|
|
}
|
|
|
|
}
|
2012-09-11 13:43:28 +04:00
|
|
|
|
2011-11-28 19:52:53 +04:00
|
|
|
actions reg_test_decode {
|
2012-09-11 13:43:28 +04:00
|
|
|
$(TOP)/regression-testing/run-single-test.perl --decoder=$(>) --test=$(<:B) --data-dir=$(with-regtest) --test-dir=$(test-dir) && touch $(<)
|
2011-11-28 19:52:53 +04:00
|
|
|
}
|
2012-11-13 01:12:01 +04:00
|
|
|
reg_test phrase : [ glob $(test-dir)/phrase.* ] : ../moses-cmd//moses : @reg_test_decode ;
|
|
|
|
reg_test chart : [ glob $(test-dir)/chart.* ] : ../moses-chart-cmd//moses_chart : @reg_test_decode ;
|
2011-11-28 19:52:53 +04:00
|
|
|
|
|
|
|
actions reg_test_score {
|
2012-09-11 13:43:28 +04:00
|
|
|
$(TOP)/regression-testing/run-test-scorer.perl --scorer=$(>) --test=$(<:B) --data-dir=$(with-regtest) --test-dir=$(test-dir) && touch $(<)
|
2011-11-28 19:52:53 +04:00
|
|
|
}
|
2012-09-18 17:06:03 +04:00
|
|
|
reg_test score : [ glob $(test-dir)/score.* : $(test-dir)/score.phrase-based-with-alignment-inv $(test-dir)/score.phrase-based-inv $(test-dir)/score.phrase-based-with-alignment $(test-dir)/score.phrase-based ] : ../phrase-extract//score : @reg_test_score ;
|
2012-06-01 19:27:59 +04:00
|
|
|
|
|
|
|
actions reg_test_extract {
|
2012-09-11 13:43:28 +04:00
|
|
|
$(TOP)/regression-testing/run-test-extract.perl --extractor=$(>) --test=$(<:B) --data-dir=$(with-regtest) --test-dir=$(test-dir) && touch $(<)
|
2012-06-01 19:27:59 +04:00
|
|
|
}
|
2012-09-11 13:43:28 +04:00
|
|
|
reg_test extract : [ glob $(test-dir)/extract.* ] : ../phrase-extract//extract : @reg_test_extract ;
|
2012-06-01 19:27:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
actions reg_test_extractrules {
|
2012-09-11 13:43:28 +04:00
|
|
|
$(TOP)/regression-testing/run-test-extract.perl --extractor=$(>) --test=$(<:B) --data-dir=$(with-regtest) --test-dir=$(test-dir) && touch $(<)
|
2012-06-01 19:27:59 +04:00
|
|
|
}
|
2012-09-11 13:43:28 +04:00
|
|
|
reg_test extractrules : [ glob $(test-dir)/extract-rules.* : $(with-regtest)/extract-rules.hierarchical ] : ../phrase-extract//extract-rules : @reg_test_extractrules ;
|
2012-06-01 19:27:59 +04:00
|
|
|
|
2012-10-04 19:08:37 +04:00
|
|
|
pwd = [ path.pwd ] ;
|
2011-11-28 19:52:53 +04:00
|
|
|
actions reg_test_mert {
|
2012-10-04 19:08:37 +04:00
|
|
|
$(TOP)/regression-testing/run-test-mert.perl --test=$(<:B) --data-dir=$(with-regtest) --test-dir=$(test-dir) --bin-dir=$(pwd)/$(>:D) && touch $(<)
|
2011-11-28 19:52:53 +04:00
|
|
|
}
|
2012-10-08 20:33:58 +04:00
|
|
|
reg_test mert : [ glob $(test-dir)/mert.* ] : ../mert//mert ../mert//extractor ../mert//pro : @reg_test_mert ;
|
2012-05-25 01:11:47 +04:00
|
|
|
|
2012-11-19 23:44:12 +04:00
|
|
|
actions reg_test_misc {
|
|
|
|
$(TOP)/regression-testing/run-test-misc.perl --moses-root=$(TOP) --moses-bin=$(BINDIR) --test=$(<:B) --data-dir=$(with-regtest) --test-dir=$(test-dir) && touch $(<)
|
|
|
|
}
|
2012-11-27 19:58:55 +04:00
|
|
|
reg_test misc : [ glob $(test-dir)/misc.* : $(test-dir)/misc.mml* ] : ..//prefix-bin ..//prefix-lib : @reg_test_misc ;
|
|
|
|
reg_test misc-mml : [ glob $(test-dir)/misc.mml* ] : $(TOP)/scripts/ems/support/mml-filter.py $(TOP)/scripts/ems/support/defaultconfig.py : @reg_test_misc ;
|
2012-11-19 23:44:12 +04:00
|
|
|
|
2012-11-27 19:58:55 +04:00
|
|
|
alias all : phrase chart mert score extract extractrules misc misc-mml ;
|
2011-11-28 19:52:53 +04:00
|
|
|
}
|