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
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
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
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
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
[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
--- /dev/null
+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
- $(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