Commit 4b82f17a authored by Alexandre Savard's avatar Alexandre Savard

Merge branch 'master' into configyaml

parents 6007308c 5ef72f40
...@@ -37,27 +37,8 @@ endif ...@@ -37,27 +37,8 @@ endif
sflphoned_CXXFLAGS = \ sflphoned_CXXFLAGS = \
-DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(IAX_CXXFLAG) $(NETWORKMANAGER) \ -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(IAX_CXXFLAG) $(NETWORKMANAGER) \
-DVERSION=\"$(VERSION)\" \
@ZRTPCPP_CFLAGS@ \
@libssl_CFLAGS@
# Add here the dynamic libraries sflphoned should be linked against
sflphoned_LDADD = \
./libsflphone.la \
@CCGNU2_LIBS@ \
@CCEXT2_LIBS@ \
@ZRTPCPP_LIBS@ \
$(PJSIP_LIBS) \
@CCRTP_LIBS@ \
@ALSA_LIBS@ \
@PULSEAUDIO_LIBS@ \
@SAMPLERATE_LIBS@ \
@libssl_LIBS@
# sflphoned_LDFLAGS= -pg -luuid
sflphoned_LDFLAGS= $(UUID_LIBS)
-DVERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
# libsflphone # libsflphone
sflphoned_LDADD = ./libsflphone.la sflphoned_LDADD = ./libsflphone.la
...@@ -85,11 +66,6 @@ libsflphone_la_LIBADD = \ ...@@ -85,11 +66,6 @@ libsflphone_la_LIBADD = \
$(IAX_LIB) \ $(IAX_LIB) \
./sip/libsiplink.la \ ./sip/libsiplink.la \
./audio/libaudio.la \ ./audio/libaudio.la \
./audio/audiortp/libaudiortp.la \
./audio/sound/libsound.la \
./audio/codecs/libcodecdescriptor.la \
./audio/alsa/libalsalayer.la \
./audio/pulseaudio/libpulselayer.la \
./dbus/libdbus.la \ ./dbus/libdbus.la \
./config/libconfig.la \ ./config/libconfig.la \
./plug-in/libplugin.la \ ./plug-in/libplugin.la \
...@@ -100,9 +76,6 @@ libsflphone_la_LDFLAGS = \ ...@@ -100,9 +76,6 @@ libsflphone_la_LDFLAGS = \
@CCGNU2_LIBS@ \ @CCGNU2_LIBS@ \
@CCEXT2_LIBS@ \ @CCEXT2_LIBS@ \
@ZRTPCPP_LIBS@ \ @ZRTPCPP_LIBS@ \
@GSTREAMER_LIBS@ \
@LIBAVCODEC_LIBS@ \
@LIBSWSCALE_LIBS@ \
$(PJSIP_LIBS) \ $(PJSIP_LIBS) \
@CCRTP_LIBS@ \ @CCRTP_LIBS@ \
@ALSA_LIBS@ \ @ALSA_LIBS@ \
...@@ -115,9 +88,6 @@ libsflphone_la_CFLAGS = \ ...@@ -115,9 +88,6 @@ libsflphone_la_CFLAGS = \
@CCGNU2_CFLAGS@ \ @CCGNU2_CFLAGS@ \
@CCEXT2_CFLAGS@ \ @CCEXT2_CFLAGS@ \
@ZRTPCPP_CFLAGS@ \ @ZRTPCPP_CFLAGS@ \
@GSTREAMER_CFLAGS@ \
@LIBAVCODEC_CFLAGS@ \
@LIBSWSCALE_CFLAGS@ \
$(PJSIP_CFLAGS) \ $(PJSIP_CFLAGS) \
@CCRTP_CFLAGS@ \ @CCRTP_CFLAGS@ \
@ALSA_CFLAGS@ \ @ALSA_CFLAGS@ \
......
...@@ -26,22 +26,19 @@ test_SOURCES = \ ...@@ -26,22 +26,19 @@ test_SOURCES = \
rtptest.h \ rtptest.h \
rtptest.cpp \ rtptest.cpp \
sdesnegotiatortest.h \ sdesnegotiatortest.h \
sdesnegotiatortest.cpp \ sdesnegotiatortest.cpp
delaydetectiontest.h \
delaydetectiontest.cpp
LLIBS=$(CPPUNIT_LIBS) \ LLIBS=$(CPPUNIT_LIBS) \
@ALSA_LIBS@ \ ../src/sflphoned-logger.o \
@PULSEAUDIO_LIBS@ \ ../src/sflphoned-managerimpl.o \
@CPPUNIT_LIBS@ \ ../src/sflphoned-account.o\
@CCEXT2_LIBS@ \ ../src/sflphoned-accountcreator.o \
@CCGNU2_LIBS@ \ ../src/sflphoned-call.o \
@CCRTP_LIBS@ \ ../src/sflphoned-conference.o \
@ZRTPCPP_LIBS@ \ ../src/sflphoned-eventthread.o \
@libssl_LIBS@ \ ../src/sflphoned-managerimpl_registration.o \
@SAMPLERATE_LIBS@ \ ../src/sflphoned-numbercleaner.o \
$(PJSIP_LIBS) \ ../src/sflphoned-observer.o \
../src/sflphoned-voiplink.o \
../src/libsflphone.la ../src/libsflphone.la
...@@ -37,40 +37,21 @@ ...@@ -37,40 +37,21 @@
#include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TextTestRunner.h> #include <cppunit/ui/text/TextTestRunner.h>
// TODO: Why some header cannot be included ?
#include "accounttest.h"
#include "audiolayertest.h"
#include "configurationtest.h"
//#include "historytest.h"
//#include "hookmanagertest.h"
#include "mainbuffertest.h"
#include "numbercleanertest.h"
//#include "pluginmanagertest.h"
//#include "rtptest.h"
#include "sdesnegotiatortest.h"
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
printf("\nSFLphone Daemon Test Suite, by Savoir-Faire Linux 2004-2010\n\n"); printf("\nSFLphone Daemon Test Suite, by Savoir-Faire Linux 2004-2010\n\n");
Logger::setConsoleLog(true); Logger::setConsoleLog(true);
Logger::setDebugMode(true); Logger::setDebugMode(true);
/*
Logger::setDebugMode(false);
int argvIndex = 1; int argvIndex = 1;
if (argc > 1) { if (argc > 1) {
if (strcmp("--help", argv[1]) == 0) { if (strcmp("--help", argv[1]) == 0) {
argvIndex++; argvIndex++;
CPPUNIT_NS::Test CPPUNIT_NS::Test* suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry("All Tests").makeTest();
*suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry(
"All Tests").makeTest();
int testSuiteCount = suite->getChildTestCount(); int testSuiteCount = suite->getChildTestCount();
printf("Usage: test [OPTIONS] [TEST_SUITE]\n"); printf("Usage: test [OPTIONS] [TEST_SUITE]\n");
printf("\nOptions:\n"); printf("\nOptions:\n");
printf(" --debug - Debug mode\n"); printf(" --debug - Debug mode\n");
...@@ -89,6 +70,7 @@ int main(int argc, char* argv[]) { ...@@ -89,6 +70,7 @@ int main(int argc, char* argv[]) {
} }
} }
// Default test suite : all tests
std::string testSuiteName = "All Tests"; std::string testSuiteName = "All Tests";
if(argvIndex < argc) if(argvIndex < argc)
{ {
...@@ -100,34 +82,28 @@ int main(int argc, char* argv[]) { ...@@ -100,34 +82,28 @@ int main(int argc, char* argv[]) {
Manager::instance().initConfigFile(true, CONFIG_SAMPLE); Manager::instance().initConfigFile(true, CONFIG_SAMPLE);
Manager::instance().init(); Manager::instance().init();
printf("\n\n=== Test Suite: %s ===\n\n", testSuiteName.c_str());
// Get the top level suite from the registry // Get the top level suite from the registry
printf("\n\n=== Test Suite: %s ===\n\n", testSuiteName.c_str());
CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry(testSuiteName).makeTest(); CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry(testSuiteName).makeTest();
*/
CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
/*
if(suite->getChildTestCount() == 0) if(suite->getChildTestCount() == 0)
{ {
_error("Invalid test suite name: %s", testSuiteName.c_str()); _error("Invalid test suite name: %s", testSuiteName.c_str());
exit(-1); exit(-1);
} }
*/
Manager::instance().initConfigFile(true, CONFIG_SAMPLE);
Manager::instance().init();
// Adds the test to the list of test to run // Adds the test to the list of test to run
CppUnit::TextTestRunner runner; CppUnit::TextTestRunner runner;
runner.addTest(suite); runner.addTest(suite);
// Change the default outputter to a compiler error format outputter // Change the default outputter to a compiler error format outputter
runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
std::cerr));
// Run the tests. // Run the tests.
bool wasSucessful = runner.run(); bool wasSucessful = runner.run();
Manager::instance().terminate();
// Return error code 1 if the one of test failed. // Return error code 1 if the one of test failed.
return wasSucessful ? 0 : 1; return wasSucessful ? 0 : 1;
Manager::instance().terminate();
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment