From d59bad87d2b3ce1abf881b0c4e5bbc7648cf368f Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Wed, 2 May 2012 02:30:52 -0400 Subject: remove dependency on gtest, remove all-static --- decoder/grammar_test.cc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'decoder/grammar_test.cc') diff --git a/decoder/grammar_test.cc b/decoder/grammar_test.cc index cde00efa..e1a94709 100644 --- a/decoder/grammar_test.cc +++ b/decoder/grammar_test.cc @@ -1,8 +1,11 @@ +#define BOOST_TEST_MODULE g_test +#include +#include + #include #include #include #include -#include #include "trule.h" #include "tdict.h" #include "grammar.h" @@ -12,18 +15,16 @@ using namespace std; -class GrammarTest : public testing::Test { - public: +struct GrammarTest { GrammarTest() { Weights::InitFromFile("test_data/weights.gt", &wts); } - protected: - virtual void SetUp() { } - virtual void TearDown() { } vector wts; }; - -TEST_F(GrammarTest,TestTextGrammar) { + +BOOST_FIXTURE_TEST_SUITE( s, GrammarTest ); + +BOOST_AUTO_TEST_CASE(TestTextGrammar) { vector w; vector ms; ModelSet models(w, ms); @@ -38,7 +39,7 @@ TEST_F(GrammarTest,TestTextGrammar) { g.AddRule(r3); } -TEST_F(GrammarTest,TestTextGrammarFile) { +BOOST_AUTO_TEST_CASE(TestTextGrammarFile) { GrammarPtr g(new TextGrammar("./test_data/grammar.prune")); vector grammars(1, g); @@ -52,8 +53,5 @@ TEST_F(GrammarTest,TestTextGrammarFile) { parser.Parse(lattice, &forest); forest.PrintGraphviz(); } +BOOST_AUTO_TEST_SUITE_END() -int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} -- cgit v1.2.3