mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
move the test directory to sflphone/test
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
||||
}
|
25
test/Makefile.am
Normal file
25
test/Makefile.am
Normal file
@ -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
|
13
test/TestMain.cpp
Normal file
13
test/TestMain.cpp
Normal file
@ -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;
|
||||
}
|
||||
|
38
test/configurationTest.cpp
Normal file
38
test/configurationTest.cpp
Normal file
@ -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 );
|
Reference in New Issue
Block a user