diff --git a/src/Makefile.am b/src/Makefile.am index 25ea06f5d50c394f6221f28ae3c157b4a3506068..2d52f24bb0e5983e6dd3dfef3028bf8bddca31ab 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ sflcodecdir = $(libdir)/sflphone/codecs -bin_PROGRAMS = sflphoned +bin_PROGRAMS = sflphoned if USE_ZEROCONF ZEROCONFDIR = zeroconf @@ -33,7 +33,7 @@ PULSEAUDIO_LIBS=-lpulse SUBDIRS = audio config dbus $(ZEROCONFDIR) #contact memmanager video mixer -sflphoned_SOURCES = eventthread.cpp main.cpp voiplink.cpp \ +sflphoned_SOURCES = eventthread.cpp main.cpp voiplink.cpp \ managerimpl.cpp observer.cpp samplerateconverter.cpp \ account.cpp sipaccount.cpp accountcreator.cpp \ sipvoiplink.cpp call.cpp sipcall.cpp \ @@ -41,7 +41,6 @@ sflphoned_SOURCES = eventthread.cpp main.cpp voiplink.cpp \ sflphoned_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(ZEROCONFFLAGS) $(IAX_FLAGS) $(SFLPHONE_CFLAGS) $(SIP_CFLAGS) -#sflphoned_LDFLAGS = -static sflphoned_LDADD = ./libsflphone.la $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) $(EXOSIP_LIBS) $(ALSAFLAG) $(PULSEAUDIO_LIBS) AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libs $(libccext2_CFLAGS) $(libccgnu2_CFLAGS) $(IAX_CFLAGS) $(USER_INCLUDES) $(libdbuscpp_CFLAGS) \ -DCODECS_DIR=\""$(sflcodecdir)"\" @@ -65,8 +64,3 @@ noinst_HEADERS = managerimpl.h manager.h global.h observer.h eventthread.h user_ account.h sipaccount.h accountcreator.h \ sipvoiplink.h call.h sipcall.h \ $(IAXHEADERS) - -#./contact/libcontact.la \ -# ./memmanager/libmemmanager.la \ -# ./mixer/libmixer.la \ -# ./video/libvideo.la diff --git a/src/test/Makefile.am b/src/test/Makefile.am deleted file mode 100644 index ad11b5d5ec1198269490c1a9eed9c9334b2850be..0000000000000000000000000000000000000000 --- a/src/test/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -bin_PROGRAMS = configurationTester - -CPPUNIT_LDFLAG = `pkg-config --libs cppunit` - -configurationTester_SOURCES = configurationTest.cpp -configurationTester_LDADD = ../.libs/libsflphone.a ../config/.libs/libconfig.a -configurationTester_LDFLAGS = $(CPPUNIT_LDFLAG) -configurationTester_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libs $(libccext2_CFLAGS) $(libccgnu2_CFLAGS) $(IAX_CFLAGS) $(USER_INCLUDES) $(libdbuscpp_CFLAGS) - diff --git a/src/test/configurationTest.cpp b/src/test/configurationTest.cpp deleted file mode 100644 index c7e8a09187bac8f7b6402ff2b25ecd24268ad1a5..0000000000000000000000000000000000000000 --- a/src/test/configurationTest.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "../manager.h" -#include "../global.h" - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/ui/text/TestRunner.h> -#include <cppunit/CompilerOutputter.h> - -class ConfigurationTest : public CppUnit::TestFixture { - - CPPUNIT_TEST_SUITE( ConfigurationTest ); - CPPUNIT_TEST( testDefaultValueAudio ); - CPPUNIT_TEST_SUITE_END(); - - public: - void setUp(){ - Manager::instance().initConfigFile(); - } - - void tearDown(){ - - } - - void testDefaultValueAudio(){ - CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, ALSA_PLUGIN ) == "default" ); - } - -}; - -CPPUNIT_TEST_SUITE_REGISTRATION( ConfigurationTest ); - -int main(){ - - CppUnit::TextUi::TestRunner runner; - CppUnit::TestFactoryRegistry ®istry = - CppUnit::TestFactoryRegistry::getRegistry() ; - runner.addTest( registry.makeTest() ) ; - runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter( - &runner.result(), - std::cerr ) ); - bool wasSuccessful = runner.run( "", false ) ; - return wasSuccessful ? 0 : 1; - - - - return 0; - - -} diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..07edd58774310657cb3dffa47b8782c00260cb21 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,25 @@ +include ../globals.mak + +bin_PROGRAMS = configurationTester + +#ALSAFLAG= -lasound +PULSEAUDIO_LIBS=-lpulse + +configurationTester_SOURCES = configurationTest.cpp \ + TestMain.cpp + +configurationTester_LDADD = ../src/libsflphone.la \ + $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) $(EXOSIP_LIBS) @ALSA_LIBS@ $(PULSEAUDIO_LIBS) @CPPUNIT_LIBS@ \ + ../src/sflphoned-managerimpl.o \ + ../src/sflphoned-accountcreator.o \ + ../src/sflphoned-call.o \ + ../src/sflphoned-sipcall.o \ + ../src/sflphoned-iaxcall.o \ + ../src/sflphoned-voiplink.o \ + ../src/sflphoned-sipvoiplink.o \ + ../src/sflphoned-iaxvoiplink.o \ + ../src/sflphoned-account.o \ + ../src/sflphoned-sipaccount.o \ + ../src/sflphoned-iaxaccount.o \ + ../src/sflphoned-eventthread.o \ + ../src/sflphoned-samplerateconverter.o diff --git a/test/TestMain.cpp b/test/TestMain.cpp new file mode 100644 index 0000000000000000000000000000000000000000..310732ac596991664f6365d5563f3873c4ef5720 --- /dev/null +++ b/test/TestMain.cpp @@ -0,0 +1,13 @@ +#include <cppunit/TextTestRunner.h> +#include <cppunit/extensions/TestFactoryRegistry.h> + +int main(int argc, const char* argv[]) +{ + CppUnit::TextTestRunner runner; + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + + runner.run(); + + return 0; +} + diff --git a/test/configurationTest.cpp b/test/configurationTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..02225a54aaf540b9673c7e72f82205af493433b4 --- /dev/null +++ b/test/configurationTest.cpp @@ -0,0 +1,38 @@ +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestCaller.h> +#include <cppunit/TestCase.h> +#include <cppunit/TestSuite.h> +#include <assert.h> + +#include "manager.h" +#include "global.h" + +// Cppunit import + +class ConfigurationTest : public CppUnit::TestCase { + + CPPUNIT_TEST_SUITE( ConfigurationTest ); + CPPUNIT_TEST( testDefaultValueAudio ); + CPPUNIT_TEST( testTheTest ); + CPPUNIT_TEST_SUITE_END(); + + public: + ConfigurationTest() : CppUnit::TestCase("Configuration Tests") {} + + void testDefaultValueAudio(){ + CPPUNIT_ASSERT( Manager::instance().getConfigString( AUDIO, ALSA_PLUGIN ) == "default" ); + } + + void testTheTest(){ + CPPUNIT_ASSERT( 3 == 2 ); + } + + void setUp(){ + } + + void tearDown(){ + } + +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( ConfigurationTest );