Commit 25e7c26a authored by Emmanuel Milou's avatar Emmanuel Milou

move the test directory to sflphone/test

parent 39de0689
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
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)
#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 &registry =
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;
}
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
#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;
}
#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 );
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