2016-06-15 17:46:13 -05:00
|
|
|
# Cap threadpools to 4 threads.
|
|
|
|
export MAX_CONCURRENCY=4
|
2016-04-06 13:50:55 -05:00
|
|
|
AUTOMAKE_OPTION = serial-tests
|
|
|
|
|
2016-09-30 03:43:04 -05:00
|
|
|
# unittest: tests that do not need loolwsd running, and that are run during a
|
|
|
|
# normal build
|
2016-10-02 09:01:46 -05:00
|
|
|
# test: tests that need loolwsd running, and that are run via 'make check'
|
2015-10-21 05:01:47 -05:00
|
|
|
check_PROGRAMS = test
|
2016-09-30 03:43:04 -05:00
|
|
|
|
2016-10-11 07:26:02 -05:00
|
|
|
noinst_PROGRAMS = test unittest
|
2015-10-21 05:01:47 -05:00
|
|
|
|
2016-11-24 08:56:06 -06:00
|
|
|
AM_CXXFLAGS = $(CPPUNIT_CFLAGS) -DTDOC=\"$(top_srcdir)/test/data\" \
|
2017-02-24 13:52:36 -06:00
|
|
|
-I${top_srcdir}/common -I${top_srcdir}/net -I${top_srcdir}/wsd -I${top_srcdir}/kit
|
2015-10-21 05:01:47 -05:00
|
|
|
|
2016-04-14 12:46:32 -05:00
|
|
|
noinst_LTLIBRARIES = \
|
2016-04-18 08:29:17 -05:00
|
|
|
unit-timeout.la unit-prefork.la \
|
2017-03-16 13:33:03 -05:00
|
|
|
unit-storage.la \
|
2016-06-22 08:57:01 -05:00
|
|
|
unit-admin.la unit-tilecache.la \
|
2016-12-16 01:46:31 -06:00
|
|
|
unit-fuzz.la unit-oob.la \
|
|
|
|
unit-minsocketbuffersize.la
|
2016-04-05 11:41:10 -05:00
|
|
|
|
2016-04-14 12:46:32 -05:00
|
|
|
MAGIC_TO_FORCE_SHLIB_CREATION = -rpath /dummy
|
2016-04-28 16:02:45 -05:00
|
|
|
AM_LDFLAGS = -pthread -module $(MAGIC_TO_FORCE_SHLIB_CREATION)
|
2016-09-28 14:07:07 -05:00
|
|
|
|
|
|
|
# We work around some of the mess of using the same sources both on
|
|
|
|
# the server side and here in unit tests with conditional compilation
|
|
|
|
# based on BUILDING_TESTS
|
|
|
|
|
|
|
|
AM_CPPFLAGS = -pthread -I$(top_srcdir) -DBUILDING_TESTS
|
2016-04-05 11:41:10 -05:00
|
|
|
|
2016-05-01 11:35:42 -05:00
|
|
|
wsd_sources = \
|
2016-11-12 15:38:13 -06:00
|
|
|
../common/FileUtil.cpp \
|
2016-11-14 07:58:04 -06:00
|
|
|
../common/SigUtil.cpp \
|
2016-11-24 08:56:06 -06:00
|
|
|
../common/IoUtil.cpp \
|
|
|
|
../common/Log.cpp \
|
|
|
|
../common/Protocol.cpp \
|
|
|
|
../common/Session.cpp \
|
2016-12-10 21:33:45 -06:00
|
|
|
../common/MessageQueue.cpp \
|
2016-11-24 08:56:06 -06:00
|
|
|
../kit/Kit.cpp \
|
|
|
|
../wsd/TileCache.cpp \
|
2017-03-15 07:07:17 -05:00
|
|
|
../wsd/TestStubs.cpp \
|
2016-11-24 08:56:06 -06:00
|
|
|
../common/Unit.cpp \
|
2017-03-02 12:12:52 -06:00
|
|
|
../common/Util.cpp \
|
|
|
|
../net/Socket.cpp
|
2016-05-01 11:35:42 -05:00
|
|
|
|
2016-09-30 03:43:04 -05:00
|
|
|
unittest_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS
|
|
|
|
unittest_SOURCES = TileQueueTests.cpp WhiteBoxTests.cpp test.cpp $(wsd_sources)
|
|
|
|
unittest_LDADD = $(CPPUNIT_LIBS)
|
|
|
|
|
2016-12-17 08:54:19 -06:00
|
|
|
test_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS
|
|
|
|
test_SOURCES = TileCacheTests.cpp integration-http-server.cpp \
|
|
|
|
httpwstest.cpp httpcrashtest.cpp httpwserror.cpp $(unittest_SOURCES)
|
|
|
|
test_LDADD = $(CPPUNIT_LIBS)
|
|
|
|
|
2016-04-05 11:41:10 -05:00
|
|
|
# unit test modules:
|
2016-12-08 11:22:23 -06:00
|
|
|
unit_oob_la_SOURCES = UnitOOB.cpp
|
2016-06-22 08:57:01 -05:00
|
|
|
unit_fuzz_la_SOURCES = UnitFuzz.cpp
|
2016-04-18 08:29:17 -05:00
|
|
|
unit_admin_la_SOURCES = UnitAdmin.cpp
|
2016-09-27 10:38:17 -05:00
|
|
|
unit_admin_la_LIBADD = $(CPPUNIT_LIBS)
|
2016-04-08 11:36:08 -05:00
|
|
|
unit_timeout_la_SOURCES = UnitTimeout.cpp
|
2016-04-07 15:59:27 -05:00
|
|
|
unit_prefork_la_SOURCES = UnitPrefork.cpp
|
|
|
|
unit_storage_la_SOURCES = UnitStorage.cpp
|
2016-05-01 09:24:31 -05:00
|
|
|
unit_tilecache_la_SOURCES = UnitTileCache.cpp
|
2016-12-16 01:46:31 -06:00
|
|
|
unit_minsocketbuffersize_la_SOURCES = UnitMinSocketBufferSize.cpp
|
2016-04-05 11:41:10 -05:00
|
|
|
|
2016-04-12 01:29:57 -05:00
|
|
|
if HAVE_LO_PATH
|
2016-04-12 01:37:24 -05:00
|
|
|
SYSTEM_STAMP = @SYSTEMPLATE_PATH@/system_stamp
|
2016-04-12 01:29:57 -05:00
|
|
|
else
|
|
|
|
SYSTEM_STAMP =
|
|
|
|
endif
|
|
|
|
|
2016-04-05 11:41:10 -05:00
|
|
|
if HAVE_LO_PATH
|
2016-10-11 07:26:02 -05:00
|
|
|
check-local:
|
2016-04-30 12:15:41 -05:00
|
|
|
./run_unit.sh --log-file test.log --trs-file test.trs
|
2017-01-16 03:15:47 -06:00
|
|
|
# FIXME 2: unit-oob.la fails with symbol undefined:
|
|
|
|
# UnitWSD::testHandleRequest(UnitWSD::TestRequest, UnitHTTPServerRequest&, UnitHTTPServerResponse&) ,
|
|
|
|
# disable for now that one too.
|
2017-03-06 16:02:54 -06:00
|
|
|
TESTS = # unit-tilecache.la unit-storage.la unit-timeout.la unit-prefork.la unit-admin.la unit-minsocketbuffersize.la
|
2016-04-05 11:41:10 -05:00
|
|
|
else
|
2016-04-06 13:50:55 -05:00
|
|
|
TESTS = ${top_builddir}/test/test
|
2016-04-05 11:41:10 -05:00
|
|
|
endif
|
|
|
|
|
2016-04-30 12:15:41 -05:00
|
|
|
TEST_EXTENSIONS = .la
|
2016-04-15 10:39:05 -05:00
|
|
|
LA_LOG_DRIVER = ${top_srcdir}/test/run_unit.sh
|
|
|
|
|
2016-09-30 03:43:04 -05:00
|
|
|
EXTRA_DIST = data/hello.odt data/hello.txt $(test_SOURCES) $(unittest_SOURCES) run_unit.sh
|
2016-05-12 17:40:59 -05:00
|
|
|
|
|
|
|
check_valgrind: all
|
|
|
|
./run_unit.sh --log-file test.log --trs-file test.trs --valgrind
|
|
|
|
|
2016-09-30 03:43:04 -05:00
|
|
|
# run unittest during the normal build
|
|
|
|
all-local: unittest
|
|
|
|
@echo
|
|
|
|
@echo "Running build-time unit tests. For more thorough testing, please run 'make check'."
|
|
|
|
@echo
|
2016-09-30 03:53:22 -05:00
|
|
|
@${top_builddir}/test/unittest 2> unittest.log || { cat unittest.log ; exit 1 ; }
|