From ac36a976d18f7d52414dae80d8bfcd94fb4ff661 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 9 Dec 2014 15:59:44 +0000 Subject: Add unit test that ensures p2 ice components compile and load --- p2pvr/Jamfile.jam | 8 ++++++++ p2pvr/daemon/Jamfile.jam | 2 ++ p2pvr/daemon/unittests/Jamfile.jam | 24 ++++++++++++++++++++++++ p2pvr/daemon/unittests/testp2ice.cpp | 35 +++++++++++++++++++++++++++++++++++ p2pvr/ice/Jamfile.jam | 4 ++++ p2pvr/webfe/.p2config | 8 ++++---- 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 p2pvr/daemon/unittests/Jamfile.jam create mode 100644 p2pvr/daemon/unittests/testp2ice.cpp diff --git a/p2pvr/Jamfile.jam b/p2pvr/Jamfile.jam index 07e533a..0268285 100644 --- a/p2pvr/Jamfile.jam +++ b/p2pvr/Jamfile.jam @@ -27,6 +27,14 @@ alias p2streams : glibmm : : : /usr/include/project2/streams "-lp2streams" ; +alias p2ut : glibmm : : : + /usr/include/project2/ut + "-lp2ut -lp2ut" +; +alias p2basics : glibmm : : : + /usr/include/project2/basics + "-lp2basics" +; alias p2ice : glibmm : : : /usr/include/project2/ice "-lp2ice -lp2iceclient" diff --git a/p2pvr/daemon/Jamfile.jam b/p2pvr/daemon/Jamfile.jam index 38e14f4..0f7eb53 100644 --- a/p2pvr/daemon/Jamfile.jam +++ b/p2pvr/daemon/Jamfile.jam @@ -34,3 +34,5 @@ unit-test testEmbedding : ../lib//p2pvrlib ; +build-project unittests ; + diff --git a/p2pvr/daemon/unittests/Jamfile.jam b/p2pvr/daemon/unittests/Jamfile.jam new file mode 100644 index 0000000..07fe5e9 --- /dev/null +++ b/p2pvr/daemon/unittests/Jamfile.jam @@ -0,0 +1,24 @@ +import testing ; + +lib boost_system ; +lib boost_filesystem ; + +path-constant me : . ; + +unit-test testp2ice : + testp2ice.cpp + : + BOOST_TEST_DYN_LINK + ../..//p2common + ../..//p2basics + ../..//p2ice + ../..//p2ut + ../../ice//p2pvrice + ../../p2comp//p2pvrp2comp + boost_system + boost_filesystem + ..//boost_utf + ROOT=\"$(me)\" + ; + + diff --git a/p2pvr/daemon/unittests/testp2ice.cpp b/p2pvr/daemon/unittests/testp2ice.cpp new file mode 100644 index 0000000..9f9e9a8 --- /dev/null +++ b/p2pvr/daemon/unittests/testp2ice.cpp @@ -0,0 +1,35 @@ +#define BOOST_TEST_MODULE ClientCompile +#include +#include +#include + +#define XSTR(s) STR(s) +#define STR(s) #s +const auto bindir = boost::filesystem::canonical("/proc/self/exe").parent_path(); +const boost::filesystem::path variant = bindir.leaf(); +const boost::filesystem::path compiler = bindir.parent_path().leaf(); +const boost::filesystem::path root = boost::filesystem::path(XSTR(ROOT)).parent_path().parent_path(); +const boost::filesystem::path iceroot = root / "ice"; + + +BOOST_AUTO_TEST_CASE( compile_client_clientOnly ) +{ + const std::string tmpdir = "/tmp/ut/p2pvr.slice"; + BOOST_TEST_CHECKPOINT("Clean up"); + boost::filesystem::remove_all(tmpdir); + + BOOST_TEST_CHECKPOINT("Configure, compile, link, load"); + TestOptionsSource::LoadTestOptions({ + { "ice.compile.tmpdir", tmpdir }, + { "ice.client.slicerclient", (iceroot / "common.ice").string() }, + { "library", (root / "ice" / "bin" / compiler / variant / "slicer-yes" / "libp2pvrice.so").string() }, + { "library", (root / "p2comp" / "bin" / compiler / variant / "libp2pvrp2comp.so").string() }, + { "ice.client.slicerclient", (iceroot / "dvbsi.ice").string() }, + { "ice.client.slicerclient", (iceroot / "dvb.ice").string() }, + { "ice.client.slicerclient", (iceroot / "p2pvr.ice").string() }, + }); + //commonTests(); + + TestOptionsSource::LoadTestOptions({ }); + //unloadTests(); +} diff --git a/p2pvr/ice/Jamfile.jam b/p2pvr/ice/Jamfile.jam index 8ece4f7..494988f 100644 --- a/p2pvr/ice/Jamfile.jam +++ b/p2pvr/ice/Jamfile.jam @@ -1,6 +1,7 @@ lib Ice ; lib IceUtil ; lib pthread ; +lib slicer ; lib p2pvrice : [ glob *.cpp *.ice ] : @@ -10,6 +11,9 @@ lib p2pvrice : ..//p2common ..//p2lib ..//p2ice + slicer + yes + /usr/include/slicer/ : : . Ice diff --git a/p2pvr/webfe/.p2config b/p2pvr/webfe/.p2config index db4692d..492c5ed 100644 --- a/p2pvr/webfe/.p2config +++ b/p2pvr/webfe/.p2config @@ -1,7 +1,7 @@ -ice.client.sliceclient = ice/common.ice +ice.client.slicerclient = ice/common.ice library = libp2pvrice.so library = libp2pvrp2comp.so -ice.client.sliceclient = ice/dvbsi.ice -ice.client.sliceclient = ice/dvb.ice -ice.client.sliceclient = ice/p2pvr.ice +ice.client.slicerclient = ice/dvbsi.ice +ice.client.slicerclient = ice/dvb.ice +ice.client.slicerclient = ice/p2pvr.ice -- cgit v1.2.3