From 5dd5ee37d4c6f491cd55c0173aea18209cdc226d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 27 Jan 2015 22:26:21 +0000 Subject: Call the compile slicer tool from the test case instead of just the library (end-to-end test improvement) --- slicer/test/Jamfile.jam | 1 + slicer/test/fileStructure.cpp | 2 +- slicer/test/preprocessor.cpp | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/slicer/test/Jamfile.jam b/slicer/test/Jamfile.jam index dde7362..b4e1046 100644 --- a/slicer/test/Jamfile.jam +++ b/slicer/test/Jamfile.jam @@ -51,6 +51,7 @@ unit-test preprocess : common .. ../slicer//slicer + ../tool//slicer ; unit-test compilation : diff --git a/slicer/test/fileStructure.cpp b/slicer/test/fileStructure.cpp index 28d1229..99f7165 100644 --- a/slicer/test/fileStructure.cpp +++ b/slicer/test/fileStructure.cpp @@ -5,7 +5,7 @@ FileStructure::FileStructure() : me(boost::filesystem::canonical("/proc/self/exe")), base("types"), - bjamout(me.parent_path()), + bjamout(me.parent_path().parent_path().parent_path().leaf() / me.parent_path().parent_path().leaf() / me.parent_path().leaf()), root(me.parent_path().parent_path().parent_path().parent_path()), slice(fs::change_extension(root / base, ".ice")), tmp(root / "bin" / "slicer") diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp index fa65a44..8b4876a 100644 --- a/slicer/test/preprocessor.cpp +++ b/slicer/test/preprocessor.cpp @@ -51,12 +51,17 @@ BOOST_AUTO_TEST_CASE( slicer_test_ice ) const fs::path cpp = fs::change_extension(tmp / base, ".cpp"); BOOST_TEST_CHECKPOINT("cpp: " << cpp); fs::remove(cpp); - Slicer::Slicer::Apply(slice, cpp); + const std::string doslice = stringbf( + "%s %s %s", + root.parent_path() / "tool" / bjamout / "slicer", + slice, cpp); + BOOST_TEST_CHECKPOINT("slicer: " << doslice); + system(doslice); const fs::path obj = fs::change_extension(tmp / base, ".o"); const std::string compile = stringbf( "g++ -Os -fPIC -c -std=c++0x -I tmp -I /usr/include/Ice -I /usr/include/IceUtil -I %s -I %s %s -o %s", - bjamout, + root / bjamout, root / "..", cpp, obj); BOOST_TEST_CHECKPOINT("compile: " << compile); @@ -65,7 +70,7 @@ BOOST_AUTO_TEST_CASE( slicer_test_ice ) const fs::path so = fs::change_extension(tmp / ("libslicer" + slice.filename().string()), ".so"); const std::string link = stringbf( "g++ -shared -lIce -lIceUtil %s/lib%s.so %s -o %s", - bjamout, base, + root / bjamout, base, obj, so); BOOST_TEST_CHECKPOINT("link: " << link); system(link); -- cgit v1.2.3