From 09b12018c5a818cb61f11dda21bda7874e79816e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 21 Jul 2015 00:04:17 +0100 Subject: Switch to run rule for capturing output, undate paths in tests --- project2/basics/unittests/Jamfile.jam | 17 +++++++++++------ project2/basics/unittests/testLibraries.cpp | 5 ++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/project2/basics/unittests/Jamfile.jam b/project2/basics/unittests/Jamfile.jam index 167c7c6..4fef202 100644 --- a/project2/basics/unittests/Jamfile.jam +++ b/project2/basics/unittests/Jamfile.jam @@ -6,26 +6,31 @@ lib dummylib : ../../common//p2common ; -unit-test testLibraries : +path-constant me : . ; + +run testLibraries.cpp - : + : : : + ROOT=\"$(me)\" dummylib ../../common//p2common ..//p2basics ../../ut//p2ut ..//boost_filesystem + : + testLibraries : ; -path-constant me : . ; - -unit-test standardTests : +run [ glob *.cpp : testLibraries.cpp dummylib.cpp ] - : + : : : ROOT=\"$(me)\" ../../common//p2common ..//p2basics ../../ut//p2ut ../../xml//p2xml ..//boost_filesystem + : + standardTests : ; diff --git a/project2/basics/unittests/testLibraries.cpp b/project2/basics/unittests/testLibraries.cpp index e48d77e..9b05166 100644 --- a/project2/basics/unittests/testLibraries.cpp +++ b/project2/basics/unittests/testLibraries.cpp @@ -6,6 +6,9 @@ #include #include +#define XSTR(s) STR(s) +#define STR(s) #s +const boost::filesystem::path root(XSTR(ROOT)); const auto self = boost::filesystem::canonical("/proc/self/exe"); BOOST_FIXTURE_TEST_SUITE( Core, TestAppInstance ); @@ -25,7 +28,7 @@ BOOST_AUTO_TEST_CASE( load_and_unload_library ) BOOST_TEST_CHECKPOINT("Configure (load)"); TestOptionsSource::LoadTestOptions({ - { "library", (self.parent_path() / "libdummylib.so").string() } + { "library", (root / "bin" / self.parent_path().parent_path().leaf() / self.parent_path().leaf() / "libdummylib.so").string() } }); BOOST_TEST_CHECKPOINT("Verify"); BOOST_REQUIRE(ElementLoader::getFor("DummyTask")); -- cgit v1.2.3