From ad6d1d9659843c731da65390fe69184c4e9775e9 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 29 Nov 2014 01:33:28 +0000 Subject: Rename library test to conform with others --- project2/basics/unittests/Jamfile.jam | 4 ++-- project2/basics/unittests/libraries.cpp | 34 ----------------------------- project2/basics/unittests/testLibraries.cpp | 34 +++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 project2/basics/unittests/libraries.cpp create mode 100644 project2/basics/unittests/testLibraries.cpp diff --git a/project2/basics/unittests/Jamfile.jam b/project2/basics/unittests/Jamfile.jam index 253cff5..76dc5ff 100644 --- a/project2/basics/unittests/Jamfile.jam +++ b/project2/basics/unittests/Jamfile.jam @@ -6,8 +6,8 @@ lib dummylib : ../../common//p2common ; -unit-test libraries : - libraries.cpp +unit-test testLibraries : + testLibraries.cpp : dummylib ../../common//p2common diff --git a/project2/basics/unittests/libraries.cpp b/project2/basics/unittests/libraries.cpp deleted file mode 100644 index c7aac5a..0000000 --- a/project2/basics/unittests/libraries.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#define BOOST_TEST_MODULE Client -#include -#include -#include -#include -#include - -const auto self = boost::filesystem::canonical("/proc/self/exe"); - -BOOST_AUTO_TEST_CASE( load_missing_library ) -{ - BOOST_TEST_CHECKPOINT("Configure (load)"); - BOOST_REQUIRE_THROW( - TestOptionsSource::LoadTestOptions({ - { "library", (self.parent_path() / "nosuchlibrary.so").string() } - }), LoadLibraryFailed); -} - -BOOST_AUTO_TEST_CASE( load_and_unload_library ) -{ - BOOST_REQUIRE_THROW(ElementLoader::getFor("DummyTask"), NotSupported); - - BOOST_TEST_CHECKPOINT("Configure (load)"); - TestOptionsSource::LoadTestOptions({ - { "library", (self.parent_path() / "libdummylib.so").string() } - }); - BOOST_TEST_CHECKPOINT("Verify"); - BOOST_REQUIRE(ElementLoader::getFor("DummyTask")); - - BOOST_TEST_CHECKPOINT("Configure (empty)"); - TestOptionsSource::LoadTestOptions({ }); - BOOST_REQUIRE_THROW(ElementLoader::getFor("DummyTask"), NotSupported); -} - diff --git a/project2/basics/unittests/testLibraries.cpp b/project2/basics/unittests/testLibraries.cpp new file mode 100644 index 0000000..c7aac5a --- /dev/null +++ b/project2/basics/unittests/testLibraries.cpp @@ -0,0 +1,34 @@ +#define BOOST_TEST_MODULE Client +#include +#include +#include +#include +#include + +const auto self = boost::filesystem::canonical("/proc/self/exe"); + +BOOST_AUTO_TEST_CASE( load_missing_library ) +{ + BOOST_TEST_CHECKPOINT("Configure (load)"); + BOOST_REQUIRE_THROW( + TestOptionsSource::LoadTestOptions({ + { "library", (self.parent_path() / "nosuchlibrary.so").string() } + }), LoadLibraryFailed); +} + +BOOST_AUTO_TEST_CASE( load_and_unload_library ) +{ + BOOST_REQUIRE_THROW(ElementLoader::getFor("DummyTask"), NotSupported); + + BOOST_TEST_CHECKPOINT("Configure (load)"); + TestOptionsSource::LoadTestOptions({ + { "library", (self.parent_path() / "libdummylib.so").string() } + }); + BOOST_TEST_CHECKPOINT("Verify"); + BOOST_REQUIRE(ElementLoader::getFor("DummyTask")); + + BOOST_TEST_CHECKPOINT("Configure (empty)"); + TestOptionsSource::LoadTestOptions({ }); + BOOST_REQUIRE_THROW(ElementLoader::getFor("DummyTask"), NotSupported); +} + -- cgit v1.2.3