summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-07-12 21:57:12 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-07-12 21:57:12 +0100
commit13635ebf534ce42313908deedbc8d4112cbdf791 (patch)
treeab90640ae39177e21f27e302b074df987951459e
parentTest options with more realistic DryIce (diff)
downloadicetray-13635ebf534ce42313908deedbc8d4112cbdf791.tar.bz2
icetray-13635ebf534ce42313908deedbc8d4112cbdf791.tar.xz
icetray-13635ebf534ce42313908deedbc8d4112cbdf791.zip
Roll up testOptions into a single lib for an empty, but otherwise realistic testService class
-rw-r--r--icetray/unittests/Jamfile.jam8
-rw-r--r--icetray/unittests/testIceTrayLogger.cpp8
-rw-r--r--icetray/unittests/testIceTrayOptions.cpp12
-rw-r--r--icetray/unittests/testService.cpp12
-rw-r--r--icetray/unittests/testService.h7
5 files changed, 28 insertions, 19 deletions
diff --git a/icetray/unittests/Jamfile.jam b/icetray/unittests/Jamfile.jam
index 91c9085..8fd034a 100644
--- a/icetray/unittests/Jamfile.jam
+++ b/icetray/unittests/Jamfile.jam
@@ -87,10 +87,12 @@ run
testIceTrayLogger.cpp
: : :
<library>testCommon
+ <library>testService
;
-lib testOptions
+lib testService
:
+ testService.cpp
testOptions.cpp
: :
<library>testCommon
@@ -100,13 +102,13 @@ run
testIceTrayOptions.cpp
: : :
<library>testCommon
- <library>testOptions
+ <library>testService
;
run
../tool/icetrayDoc.cpp
: :
- testOptions
+ testService
:
<library>..//adhocutil
<library>..//icetray
diff --git a/icetray/unittests/testIceTrayLogger.cpp b/icetray/unittests/testIceTrayLogger.cpp
index 81f0023..68e8ccc 100644
--- a/icetray/unittests/testIceTrayLogger.cpp
+++ b/icetray/unittests/testIceTrayLogger.cpp
@@ -10,6 +10,7 @@
#include <boost/format.hpp>
#include <slicer/common.h>
#include <logWriterConsole.h>
+#include "testService.h"
using namespace IceTray::Logging;
@@ -295,13 +296,6 @@ BOOST_AUTO_TEST_CASE( domains_fromProperties_badLevel )
BOOST_AUTO_TEST_SUITE_END();
-class TestService : public IceTray::Service {
- public:
- void addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &)
- {
- }
-};
-
BOOST_FIXTURE_TEST_SUITE( ts, TestService );
BOOST_AUTO_TEST_CASE( getLogger )
diff --git a/icetray/unittests/testIceTrayOptions.cpp b/icetray/unittests/testIceTrayOptions.cpp
index 22776b9..09497be 100644
--- a/icetray/unittests/testIceTrayOptions.cpp
+++ b/icetray/unittests/testIceTrayOptions.cpp
@@ -8,15 +8,9 @@
#include "icetrayService.h"
#include "dryice.h"
-class TestService : public IceTray::Service {
- public:
- void addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &)
- {
- // Verifies option resolution is available for addObjects.
- IceTray::OptionsResolver<TestOptions> myOpts;
- }
-};
-NAMEDFACTORY("default", TestService, IceTray::ServiceFactory);
+//
+// TestService is pulled in from libtestService.so
+//
class DI : public IceTray::DryIce {
public:
diff --git a/icetray/unittests/testService.cpp b/icetray/unittests/testService.cpp
new file mode 100644
index 0000000..88a61e9
--- /dev/null
+++ b/icetray/unittests/testService.cpp
@@ -0,0 +1,12 @@
+#include "testService.h"
+#include "testOptions.h"
+
+void
+TestService::addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &)
+{
+ // Verifies option resolution is available for addObjects.
+ IceTray::OptionsResolver<TestOptions> myOpts;
+}
+
+NAMEDFACTORY("default", TestService, IceTray::ServiceFactory);
+
diff --git a/icetray/unittests/testService.h b/icetray/unittests/testService.h
new file mode 100644
index 0000000..7c5a0ae
--- /dev/null
+++ b/icetray/unittests/testService.h
@@ -0,0 +1,7 @@
+#include <icetrayService.h>
+
+class DLL_PUBLIC TestService : public IceTray::Service {
+ public:
+ void addObjects(const std::string &, const Ice::CommunicatorPtr &, const Ice::StringSeq &, const Ice::ObjectAdapterPtr &) override;
+};
+