diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-05-11 20:31:57 -0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-05-11 20:31:57 -0400 |
commit | 5d2d8752f03934acb61dc9ca826563900d413e44 (patch) | |
tree | f16863dfe3df191193a221b99ae96be58d4611cc /mteval | |
parent | 45a28264df3f1347eba603ee0758e5d7f063c327 (diff) |
Fix relative paths in tests.
Diffstat (limited to 'mteval')
-rw-r--r-- | mteval/Jamfile | 2 | ||||
-rw-r--r-- | mteval/scorer_test.cc | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/mteval/Jamfile b/mteval/Jamfile index f671134a..24a95e8f 100644 --- a/mteval/Jamfile +++ b/mteval/Jamfile @@ -5,4 +5,4 @@ exe fast_score : fast_score.cc mteval ..//utils ..//boost_program_options ; exe mbr_kbest : mbr_kbest.cc mteval ..//utils ..//boost_program_options ; alias programs : fast_score mbr_kbest ; -unit-test scorer_test : scorer_test.cc mteval ..//utils ..//z ..//boost_unit_test_framework ; +unit-test scorer_test : scorer_test.cc mteval ..//utils ..//z ..//boost_unit_test_framework : <testing.arg>$(TOP)/mteval/test_data ; diff --git a/mteval/scorer_test.cc b/mteval/scorer_test.cc index 0e400a3a..9b765d0f 100644 --- a/mteval/scorer_test.cc +++ b/mteval/scorer_test.cc @@ -36,11 +36,12 @@ struct Stuff { BOOST_FIXTURE_TEST_SUITE( s, Stuff ); BOOST_AUTO_TEST_CASE(TestCreateFromFiles) { + std::string path(boost::unit_test::framework::master_test_suite().argc == 2 ? boost::unit_test::framework::master_test_suite().argv[1] : "test_data"); vector<string> files; - files.push_back("test_data/re.txt.0"); - files.push_back("test_data/re.txt.1"); - files.push_back("test_data/re.txt.2"); - files.push_back("test_data/re.txt.3"); + files.push_back(path + "/re.txt.0"); + files.push_back(path + "/re.txt.1"); + files.push_back(path + "/re.txt.2"); + files.push_back(path + "/re.txt.3"); DocScorer ds(IBM_BLEU, files); } |