From db9af512c5e7a54b15f0d112365fdb11d21eab22 Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 7 Nov 2014 18:52:44 +0000 Subject: Move tests into their own folder --- project2/ice/Jamfile.jam | 25 +++---------------------- project2/ice/test.ice | 9 --------- project2/ice/testClient.cpp | 32 -------------------------------- project2/ice/tests/Jamfile.jam | 22 ++++++++++++++++++++++ project2/ice/tests/test.ice | 9 +++++++++ project2/ice/tests/testClient.cpp | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 63 deletions(-) delete mode 100644 project2/ice/test.ice delete mode 100644 project2/ice/testClient.cpp create mode 100644 project2/ice/tests/Jamfile.jam create mode 100644 project2/ice/tests/test.ice create mode 100644 project2/ice/tests/testClient.cpp diff --git a/project2/ice/Jamfile.jam b/project2/ice/Jamfile.jam index d6cf16f..67e9eab 100644 --- a/project2/ice/Jamfile.jam +++ b/project2/ice/Jamfile.jam @@ -1,5 +1,3 @@ -import testing ; - alias glibmm : : : : "`pkg-config --cflags glibmm-2.4`" "`pkg-config --libs glibmm-2.4`" @@ -12,6 +10,8 @@ lib IceUtil ; lib pthread ; lib boost_filesystem ; +build-project tests ; + cpp-pch pch : pch.hpp : ../../libmisc ../lib//p2lib @@ -36,6 +36,7 @@ lib p2iceclient : : : p2ice ../common//p2common + . ; lib p2icedaemon : @@ -72,23 +73,3 @@ lib p2ice : boost_filesystem ; -lib test : - test.ice - : - Ice - IceUtil - pthread - ; - -unit-test testClient : - [ glob testClient.cpp ] - : - test.ice - p2iceclient - ../ut//p2ut - ../basics//p2basics - Ice - IceUtil - boost_filesystem - ; - diff --git a/project2/ice/test.ice b/project2/ice/test.ice deleted file mode 100644 index 3c18999..0000000 --- a/project2/ice/test.ice +++ /dev/null @@ -1,9 +0,0 @@ -module test { - interface a - { - ["project2:task"] - void someTask(); - - }; -}; - diff --git a/project2/ice/testClient.cpp b/project2/ice/testClient.cpp deleted file mode 100644 index d7256ae..0000000 --- a/project2/ice/testClient.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#define BOOST_TEST_MODULE Client -#include -#include -#include "iceClient.h" -#include - -const auto self = boost::filesystem::canonical("/proc/self/exe"); -const Glib::ustring testPlatform; - -BOOST_AUTO_TEST_CASE( compile_client_full ) -{ - const std::string tmpdir = "/tmp/ut/project2.slice/full"; - boost::filesystem::remove_all(tmpdir); - - TestOptionsSource::LoadTestOptions({ - { "ice.compile.tmpdir", tmpdir }, - { "ice.client.slice", "test.ice" } - }); -} - -BOOST_AUTO_TEST_CASE( compile_client_clientOnly ) -{ - const std::string tmpdir = "/tmp/ut/project2.slice/clientOnly"; - boost::filesystem::remove_all(tmpdir); - - TestOptionsSource::LoadTestOptions({ - { "library", (self.parent_path() / "libtest.so").string() }, - { "ice.compile.tmpdir", tmpdir }, - { "ice.client.sliceclient", "test.ice" } - }); -} - diff --git a/project2/ice/tests/Jamfile.jam b/project2/ice/tests/Jamfile.jam new file mode 100644 index 0000000..2081be6 --- /dev/null +++ b/project2/ice/tests/Jamfile.jam @@ -0,0 +1,22 @@ +import testing ; + +lib test : + test.ice + : + ..//Ice + ..//IceUtil + ..//pthread + ; + +unit-test testClient : + [ glob testClient.cpp ] + : + test.ice + ..//p2iceclient + ../../ut//p2ut + ../../basics//p2basics + ..//Ice + ..//IceUtil + ..//boost_filesystem + ; + diff --git a/project2/ice/tests/test.ice b/project2/ice/tests/test.ice new file mode 100644 index 0000000..3c18999 --- /dev/null +++ b/project2/ice/tests/test.ice @@ -0,0 +1,9 @@ +module test { + interface a + { + ["project2:task"] + void someTask(); + + }; +}; + diff --git a/project2/ice/tests/testClient.cpp b/project2/ice/tests/testClient.cpp new file mode 100644 index 0000000..2cc3651 --- /dev/null +++ b/project2/ice/tests/testClient.cpp @@ -0,0 +1,33 @@ +#define BOOST_TEST_MODULE Client +#include +#include +#include "iceClient.h" +#include + +const auto self = boost::filesystem::canonical("/proc/self/exe"); +const auto iceroot = self.parent_path().parent_path().parent_path().parent_path(); +const Glib::ustring testPlatform; + +BOOST_AUTO_TEST_CASE( compile_client_full ) +{ + const std::string tmpdir = "/tmp/ut/project2.slice/full"; + boost::filesystem::remove_all(tmpdir); + + TestOptionsSource::LoadTestOptions({ + { "ice.compile.tmpdir", tmpdir }, + { "ice.client.slice", (iceroot / "test.ice").string() } + }); +} + +BOOST_AUTO_TEST_CASE( compile_client_clientOnly ) +{ + const std::string tmpdir = "/tmp/ut/project2.slice/clientOnly"; + boost::filesystem::remove_all(tmpdir); + + TestOptionsSource::LoadTestOptions({ + { "library", (self.parent_path() / "libtest.so").string() }, + { "ice.compile.tmpdir", tmpdir }, + { "ice.client.sliceclient", (iceroot / "test.ice").string() } + }); +} + -- cgit v1.2.3