summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-07-21 00:04:17 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-07-21 09:00:14 +0100
commit09b12018c5a818cb61f11dda21bda7874e79816e (patch)
treeff5c2c3712afafb3d59323d24d74122769762414
parentRemove some unused legacy threading code (diff)
downloadproject2-09b12018c5a818cb61f11dda21bda7874e79816e.tar.bz2
project2-09b12018c5a818cb61f11dda21bda7874e79816e.tar.xz
project2-09b12018c5a818cb61f11dda21bda7874e79816e.zip
Switch to run rule for capturing output, undate paths in tests
-rw-r--r--project2/basics/unittests/Jamfile.jam17
-rw-r--r--project2/basics/unittests/testLibraries.cpp5
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"));