Some compilers seems to optimize away our tests. Compiling them
statically and force initiating them seems to do the trick.
This commit is contained in:
parent
a78773a8ed
commit
b56823a6e7
11 changed files with 59 additions and 34 deletions
|
@ -2,7 +2,7 @@ FILE(GLOB SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*Test.cpp" )
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
|
||||||
|
|
||||||
ADD_LIBRARY(TelldusCommonTests SHARED ${SRCS} )
|
ADD_LIBRARY(TelldusCommonTests STATIC ${SRCS} )
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES( TelldusCommonTests TelldusCommon ${CPPUNIT} )
|
TARGET_LINK_LIBRARIES( TelldusCommonTests TelldusCommon ${CPPUNIT} )
|
||||||
ADD_DEPENDENCIES( TelldusCommonTests TelldusCommon )
|
ADD_DEPENDENCIES( TelldusCommonTests TelldusCommon )
|
||||||
|
|
11
telldus-core/tests/common/CommonTests.h
Normal file
11
telldus-core/tests/common/CommonTests.h
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#ifndef COMMONTESTS_H
|
||||||
|
#define COMMONTESTS_H
|
||||||
|
|
||||||
|
#include "StringsTest.h"
|
||||||
|
|
||||||
|
namespace CommonTests {
|
||||||
|
inline void setup() {
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION (StringsTest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // COMMONTESTS_H
|
|
@ -1,8 +1,6 @@
|
||||||
#include "StringsTest.h"
|
#include "StringsTest.h"
|
||||||
#include "Strings.h"
|
#include "Strings.h"
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION (StringsTest);
|
|
||||||
|
|
||||||
void StringsTest :: setUp (void)
|
void StringsTest :: setUp (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,15 @@
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
#include "common/CommonTests.h"
|
||||||
|
#include "service/ServiceTests.h"
|
||||||
|
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
// Setup our tests
|
||||||
|
CommonTests::setup();
|
||||||
|
ServiceTests::setup();
|
||||||
|
|
||||||
// informs test-listener about testresults
|
// informs test-listener about testresults
|
||||||
CPPUNIT_NS :: TestResult testresult;
|
CPPUNIT_NS :: TestResult testresult;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ FILE(GLOB SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*Test.cpp" )
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
ADD_LIBRARY(TelldusServiceTests SHARED ${SRCS} )
|
ADD_LIBRARY(TelldusServiceTests STATIC ${SRCS} )
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES( TelldusServiceTests TelldusServiceStatic ${CPPUNIT} )
|
TARGET_LINK_LIBRARIES( TelldusServiceTests TelldusServiceStatic ${CPPUNIT} )
|
||||||
ADD_DEPENDENCIES( TelldusServiceTests ${telldus-service_TARGET} )
|
ADD_DEPENDENCIES( TelldusServiceTests ${telldus-service_TARGET} )
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#include "ProtocolEverflourishTest.h"
|
#include "ProtocolEverflourishTest.h"
|
||||||
#include "service/ProtocolEverflourish.h"
|
#include "service/ProtocolEverflourish.h"
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolEverflourishTest);
|
|
||||||
|
|
||||||
class ProtocolEverflourishTest::PrivateData {
|
class ProtocolEverflourishTest::PrivateData {
|
||||||
public:
|
public:
|
||||||
ProtocolEverflourish *protocol;
|
ProtocolEverflourish *protocol;
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#include "ProtocolNexaTest.h"
|
#include "ProtocolNexaTest.h"
|
||||||
#include "service/ProtocolNexa.h"
|
#include "service/ProtocolNexa.h"
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolNexaTest);
|
|
||||||
|
|
||||||
class ProtocolNexaTest::PrivateData {
|
class ProtocolNexaTest::PrivateData {
|
||||||
public:
|
public:
|
||||||
ProtocolNexa *protocol;
|
ProtocolNexa *protocol;
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#include "ProtocolOregonTest.h"
|
#include "ProtocolOregonTest.h"
|
||||||
#include "service/ProtocolOregon.h"
|
#include "service/ProtocolOregon.h"
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolOregonTest);
|
|
||||||
|
|
||||||
class ProtocolOregonTest::PrivateData {
|
class ProtocolOregonTest::PrivateData {
|
||||||
public:
|
public:
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#include "ProtocolSartanoTest.h"
|
#include "ProtocolSartanoTest.h"
|
||||||
#include "service/ProtocolSartano.h"
|
#include "service/ProtocolSartano.h"
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolSartanoTest);
|
|
||||||
|
|
||||||
class ProtocolSartanoTest::PrivateData {
|
class ProtocolSartanoTest::PrivateData {
|
||||||
public:
|
public:
|
||||||
ProtocolSartano *protocol;
|
ProtocolSartano *protocol;
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#include "ProtocolX10Test.h"
|
#include "ProtocolX10Test.h"
|
||||||
#include "service/ProtocolX10.h"
|
#include "service/ProtocolX10.h"
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolX10Test);
|
|
||||||
|
|
||||||
class ProtocolX10Test::PrivateData {
|
class ProtocolX10Test::PrivateData {
|
||||||
public:
|
public:
|
||||||
ProtocolX10 *protocol;
|
ProtocolX10 *protocol;
|
||||||
|
|
19
telldus-core/tests/service/ServiceTests.h
Normal file
19
telldus-core/tests/service/ServiceTests.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef SERVICETESTS_H
|
||||||
|
#define SERVICETESTS_H
|
||||||
|
|
||||||
|
#include "ProtocolEverflourishTest.h"
|
||||||
|
#include "ProtocolNexaTest.h"
|
||||||
|
#include "ProtocolOregonTest.h"
|
||||||
|
#include "ProtocolSartanoTest.h"
|
||||||
|
#include "ProtocolX10Test.h"
|
||||||
|
|
||||||
|
namespace ServiceTests {
|
||||||
|
inline void setup() {
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolEverflourishTest);
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolNexaTest);
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolOregonTest);
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolSartanoTest);
|
||||||
|
CPPUNIT_TEST_SUITE_REGISTRATION (ProtocolX10Test);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // SERVICETESTS_H
|
Loading…
Add table
Add a link
Reference in a new issue