diff options
-rw-r--r-- | libadhocutil/definedDirs.h | 12 | ||||
-rw-r--r-- | libadhocutil/unittests/Jamfile.jam | 2 | ||||
-rw-r--r-- | libadhocutil/unittests/testDirs.cpp | 2 | ||||
-rw-r--r-- | libadhocutil/unittests/testPluginsRuntime.cpp | 10 |
4 files changed, 10 insertions, 16 deletions
diff --git a/libadhocutil/definedDirs.h b/libadhocutil/definedDirs.h index 9c1cc84..d3e6507 100644 --- a/libadhocutil/definedDirs.h +++ b/libadhocutil/definedDirs.h @@ -10,21 +10,9 @@ #define XSTR(s) STR(s) #define STR(s) #s -namespace AdHoc { - static boost::filesystem::path getBuildVariant(boost::filesystem::path binDir) - { - boost::filesystem::path p; - while (strncmp(p.c_str(), "gcc-", 4)) { - p = binDir.leaf() / p; - binDir = binDir.parent_path(); - } - return p; - } -} const boost::filesystem::path selfExe = boost::filesystem::canonical("/proc/self/exe"); const boost::filesystem::path binDir = selfExe.parent_path(); const boost::filesystem::path rootDir(XSTR(ROOT)); -const boost::filesystem::path buildVariant = AdHoc::getBuildVariant(binDir); #endif diff --git a/libadhocutil/unittests/Jamfile.jam b/libadhocutil/unittests/Jamfile.jam index dd0a80f..fbf92b4 100644 --- a/libadhocutil/unittests/Jamfile.jam +++ b/libadhocutil/unittests/Jamfile.jam @@ -196,7 +196,7 @@ run run testPluginsRuntime.cpp - : : : + : : utilTestClasses : <define>ROOT=\"$(me)\" <define>BOOST_TEST_DYN_LINK <library>..//adhocutil diff --git a/libadhocutil/unittests/testDirs.cpp b/libadhocutil/unittests/testDirs.cpp index f215d49..4e07f94 100644 --- a/libadhocutil/unittests/testDirs.cpp +++ b/libadhocutil/unittests/testDirs.cpp @@ -12,7 +12,5 @@ BOOST_AUTO_TEST_CASE( iexist ) BOOST_REQUIRE_EQUAL("unittests", rootDir.leaf().string()); BOOST_REQUIRE(boost::filesystem::is_directory(binDir)); BOOST_REQUIRE_EQUAL("libadhocutil", rootDir.parent_path().leaf().string()); - BOOST_REQUIRE(buildVariant.is_relative()); - BOOST_REQUIRE_EQUAL(selfExe, rootDir / "bin" / "testDirs.test" / buildVariant / "testDirs"); } diff --git a/libadhocutil/unittests/testPluginsRuntime.cpp b/libadhocutil/unittests/testPluginsRuntime.cpp index 654c6ad..b333104 100644 --- a/libadhocutil/unittests/testPluginsRuntime.cpp +++ b/libadhocutil/unittests/testPluginsRuntime.cpp @@ -9,7 +9,15 @@ using namespace AdHoc; -auto lib = rootDir / "bin" / buildVariant / "libutilTestClasses.so"; +boost::filesystem::path lib; +struct GetLibPath { + GetLibPath() + { + BOOST_REQUIRE_EQUAL(2, boost::unit_test::framework::master_test_suite().argc); + lib = boost::unit_test::framework::master_test_suite().argv[1]; + } +}; +BOOST_TEST_GLOBAL_FIXTURE(GetLibPath); static std::optional<std::string> nullResolver(const std::type_info &, const std::string &); static std::optional<std::string> badResolver(const std::type_info &, const std::string &); |