summaryrefslogtreecommitdiff
path: root/p2pvr/daemon
diff options
context:
space:
mode:
authorDan Goodliffe <randomdan@akira.random.lan>2014-12-09 15:59:44 +0000
committerDan Goodliffe <randomdan@akira.random.lan>2014-12-09 15:59:44 +0000
commitac36a976d18f7d52414dae80d8bfcd94fb4ff661 (patch)
treed6c0ea53eb9b288b470d88032e0d8a91bb565693 /p2pvr/daemon
parentSupport complex types in rows and parameters (diff)
downloadp2pvr-ac36a976d18f7d52414dae80d8bfcd94fb4ff661.tar.bz2
p2pvr-ac36a976d18f7d52414dae80d8bfcd94fb4ff661.tar.xz
p2pvr-ac36a976d18f7d52414dae80d8bfcd94fb4ff661.zip
Add unit test that ensures p2 ice components compile and load
Diffstat (limited to 'p2pvr/daemon')
-rw-r--r--p2pvr/daemon/Jamfile.jam2
-rw-r--r--p2pvr/daemon/unittests/Jamfile.jam24
-rw-r--r--p2pvr/daemon/unittests/testp2ice.cpp35
3 files changed, 61 insertions, 0 deletions
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 :
<library>../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
+ :
+ <define>BOOST_TEST_DYN_LINK
+ <library>../..//p2common
+ <library>../..//p2basics
+ <library>../..//p2ice
+ <library>../..//p2ut
+ <dependency>../../ice//p2pvrice
+ <dependency>../../p2comp//p2pvrp2comp
+ <library>boost_system
+ <library>boost_filesystem
+ <library>..//boost_utf
+ <define>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 <boost/test/unit_test.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <testOptionsSource.h>
+
+#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();
+}