Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Moved the unit testing compilation into a separate Makefile
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Mar 2016 11:27:05 +0000 (11:27 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Mar 2016 11:27:05 +0000 (11:27 +0000)
source/Makefile.in
source/configure
source/configure.ac
source/tests/Makefile.in [new file with mode: 0644]
source/tests/test.commands

index 3b8e534..9ec3eb4 100644 (file)
@@ -113,11 +113,12 @@ imexobjs: $(IMEXOBJS)
 clean:\r
        rm -f $(XAB_OUT) $(BMCO_HELP) tools/bitmapcode.o *.o \\r
        vcard/*.o common/*.o carddav/*.o contacteditor/*.o search/*.o \\r
-       widgets/*.o export/*.o import/*.o actmgr/*.o tests/$(XAB_OUT)_test \\r
-       tests/Temp* contacteditor/cdo/*.o\r
+       widgets/*.o export/*.o import/*.o actmgr/*.o contacteditor/cdo/*.o \\r
+       tests/Temp* tests/*.o tests/$(XAB_OUT)_test\r
 \r
 distclean: clean\r
-       rm -f Makefile config.status config.log bitmapsdone \\r
+       rm -f Makefile tests/Makefile \\r
+       config.status config.log bitmapsdone \\r
        tools/bitmapcode.helper bitmaps.h\r
        find bitmaps -name "*.cpp" -type f -delete\r
        find bitmaps -name "*.h" -type f -delete\r
@@ -136,4 +137,4 @@ uninstall:
        rm @BINDIR@/$(XAB_OUT)\r
 \r
 test:\r
-@GTEST@\r
+       @echo "To build and run the unit tests, run 'make' from the tests directory."\r
index 4712964..7694d1b 100755 (executable)
@@ -4968,7 +4968,7 @@ if test -z "$GTEST_FOUND_TRUE"; then :
   echo "Google Test found on the system. Enabling Unit Tests."
 fi;
 
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile tests/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -5558,7 +5558,7 @@ esac
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
-config_files="$ac_config_files"
+config_files="`echo $ac_config_files`"
 
 _ACEOF
 
@@ -5700,6 +5700,7 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
index ed9cdaf..3b75ca2 100644 (file)
@@ -192,5 +192,5 @@ AM_COND_IF([GTEST_FOUND], [AC_SUBST([GTEST], [`cat tests/test.commands`])],
        [AC_SUBST([GTEST], ["   @echo \"Google Test was not found on the system. Unable to build tests.\""])])
 AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile tests/Makefile])
 AC_OUTPUT
diff --git a/source/tests/Makefile.in b/source/tests/Makefile.in
new file mode 100644 (file)
index 0000000..6796431
--- /dev/null
@@ -0,0 +1,37 @@
+CPP=g++
+STRIP=strip
+CPPFLAGS=`xml2-config --cflags` `wx-config --cxxflags` -I.. -std=c++11 -pthread @DBGOUT@
+CPPLIBS=`wx-config --libs` `curl-config --libs` -lsfml-audio -lxml2 -lgtest
+MAKE=make
+OBJDIR=.
+
+XABTEST_OUT=xestiaab_test
+
+TESTOBJS=$(addprefix $(OBJDIR)/, ../contacteditor/cdo/ContactDataObject-unittest.o \
+ ../convert-unittest.o \
+ ../common/textprocessing-unittest.o \
+ ../vcard/vcard34conv-unittest.o \
+ ../vcard/vcard34conv-v3conv-unittest.o \
+ ../vcard/vcard34conv-v4conv-unittest.o \
+ ../vcard/vcard-unittest.o \
+ xestiaab_test.o)
+default: testobjs
+@GTEST@
+
+%.o: %.cpp
+       $(CPP) $(CPPFLAGS) -c -o $@ $<
+       
+%-unittest.o: %.cpp
+       $(CPP) $(CPPFLAGS) -c -o $@ $<
+       
+testobjs: $(TESTOBJS)
+
+clean:
+       rm -rf *.o ../*-unittest.o $(XABTEST_OUT)
+       rm -rf ../contacteditor/cdo/*-unittest.o
+       rm -rf ../common/*-unittest.o
+       rm -rf ../vcard/*-unittest.o
+       chmod 644 InvalidPermissions.vcf
+       
+-include $(TESTOBJS:.o=.d)
\ No newline at end of file
index c962107..4f10c05 100644 (file)
@@ -1,2 +1,2 @@
-       $(CPP) $(CPPFLAGS) -pthread -I. contacteditor/cdo/ContactDataObject.cpp convert.cpp common/textprocessing.cpp vcard/vcard34conv.cpp vcard/vcard34conv-v3conv.cpp vcard/vcard34conv-v4conv.cpp vcard/vcard.cpp tests/xestiaab_test.cpp -o tests/$(XAB_OUT)_test $(CPPLIBS) -lgtest
-       chmod 000 tests/InvalidPermissions.vcf
+       $(CPP) $(CPPFLAGS) $(TESTOBJS) -o $(XABTEST_OUT) $(CPPLIBS)
+       chmod 000 InvalidPermissions.vcf
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy