mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Add moses and mira unit tests to bjam build.
This commit is contained in:
parent
b2c1e97a53
commit
a64bba48ad
1
Jamroot
1
Jamroot
@ -188,6 +188,7 @@ build-project mert ;
|
||||
build-project moses-cmd/src ;
|
||||
build-project moses-chart-cmd/src ;
|
||||
build-project mira ;
|
||||
build-project moses/src ;
|
||||
#Scripts have their own binaries.
|
||||
build-project scripts ;
|
||||
#Regression tests (only does anything if --with-regtest is passed)
|
||||
|
10
mira/Jamfile
10
mira/Jamfile
@ -1,6 +1,12 @@
|
||||
exe mira :
|
||||
[ glob *.cpp ]
|
||||
lib mira_lib :
|
||||
[ glob *.cpp : *Test.cpp Main.cpp ]
|
||||
../moses/src//moses ../OnDiskPt//OnDiskPt ..//boost_program_options ;
|
||||
|
||||
exe mira : Main.cpp mira_lib ;
|
||||
|
||||
alias programs : mira ;
|
||||
|
||||
import testing ;
|
||||
|
||||
unit-test mira_test : [ glob *Test.cpp ] mira_lib ..//boost_unit_test_framework ;
|
||||
|
||||
|
@ -12,6 +12,10 @@ if [ option.get "with-synlm" : no : yes ] = yes
|
||||
}
|
||||
|
||||
lib moses :
|
||||
#All cpp files except those listed
|
||||
[ glob *.cpp DynSAInclude/*.cpp : ThreadPool.cpp SyntacticLanguageModel.cpp ]
|
||||
#All cpp files except those listed, and test files
|
||||
[ glob *.cpp DynSAInclude/*.cpp : ThreadPool.cpp SyntacticLanguageModel.cpp *Test.cpp Mock*.cpp ]
|
||||
synlm ThreadPool LM//LM headers ../..//z ../../OnDiskPt//OnDiskPt ;
|
||||
|
||||
import testing ;
|
||||
|
||||
unit-test moses_test : [ glob *Test.cpp Mock*.cpp ] moses ../..//boost_unit_test_framework ;
|
||||
|
@ -35,8 +35,8 @@ MockHypothesisGuard::MockHypothesisGuard(
|
||||
const string& sourceSentence,
|
||||
const vector<Alignment>& alignments,
|
||||
const vector<string>& targetSegments)
|
||||
: m_emptyTarget(Input),
|
||||
m_sentence(Input),
|
||||
: m_emptyTarget(),
|
||||
m_sentence(),
|
||||
m_system("mock",&m_wp,&m_uwp,&m_dist),
|
||||
m_manager(m_sentence,Normal,&m_system)
|
||||
{
|
@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(score_components)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(empty_hypo)
|
||||
{
|
||||
Sentence s(Input);
|
||||
Sentence s;
|
||||
TargetBigramFeature tbf;
|
||||
auto_ptr<const FFState> ffs(tbf.EmptyHypothesisState(s));
|
||||
BOOST_CHECK(ffs.get());
|
||||
@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE(evaluate_empty)
|
||||
HypothesisFixture hypos;
|
||||
TargetBigramFeature tbf;
|
||||
BOOST_CHECK(tbf.Load("*"));
|
||||
auto_ptr<const FFState> prevState(tbf.EmptyHypothesisState(Sentence(Input)));
|
||||
auto_ptr<const FFState> prevState(tbf.EmptyHypothesisState(Sentence()));
|
||||
ScoreComponentCollection scc;
|
||||
auto_ptr<const FFState> currState(
|
||||
tbf.Evaluate(*hypos.empty(),prevState.get(),&scc));
|
@ -1,12 +0,0 @@
|
||||
bin_PROGRAMS = moses_test
|
||||
moses_test_SOURCES = FeatureVectorTest.cpp \
|
||||
HildrethTest.cpp \
|
||||
MockHypothesis.cpp \
|
||||
MosesTest.cpp \
|
||||
ScoreComponentCollectionTest.cpp \
|
||||
TargetBigramFeatureTest.cpp \
|
||||
../mira/Hildreth.cpp
|
||||
|
||||
moses_test_CPPFLAGS = -W -Wall -I$(top_srcdir)/moses/src -I$(top_srcdir)/mira $(BOOST_CPPFLAGS) -DBOOST_TEST_DYN_LINK
|
||||
moses_test_LDADD = -L$(top_srcdir)/moses/src -lmoses $(BOOST_LDFLAGS) $(BOOST_THREAD_LIBS) -L$(top_srcdir)/OnDiskPt/src -lOnDiskPt $(top_srcdir)/util/libkenutil.la $(top_srcdir)/lm/libkenlm.la -lboost_unit_test_framework
|
||||
moses_test_DEPENDENCIES = $(top_srcdir)/moses/src/libmoses.la $(top_srcdir)/OnDiskPt/src/libOnDiskPt.a
|
Loading…
Reference in New Issue
Block a user