diff options
-rw-r--r-- | project2/basics/unittests/Jamfile.jam | 17 | ||||
-rw-r--r-- | 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 : <library>../../common//p2common ; -unit-test testLibraries : +path-constant me : . ; + +run testLibraries.cpp - : + : : : + <define>ROOT=\"$(me)\" <dependency>dummylib <library>../../common//p2common <library>..//p2basics <library>../../ut//p2ut <library>..//boost_filesystem + : + testLibraries : ; -path-constant me : . ; - -unit-test standardTests : +run [ glob *.cpp : testLibraries.cpp dummylib.cpp ] - : + : : : <define>ROOT=\"$(me)\" <library>../../common//p2common <library>..//p2basics <library>../../ut//p2ut <library>../../xml//p2xml <library>..//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 <library.h> #include <testAppInstance.h> +#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")); |