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-10-21 06:29:18 -05:00
|
|
|
AM_CXXFLAGS = $(CPPUNIT_CFLAGS) -DTDOC=\"$(top_srcdir)/test/data\"
|
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 \
|
|
|
|
unit-storage.la unit-fonts.la \
|
2016-06-22 08:57:01 -05:00
|
|
|
unit-admin.la unit-tilecache.la \
|
2016-11-17 11:34:52 -06:00
|
|
|
unit-fuzz.la unit-requests.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-05-01 11:35:42 -05:00
|
|
|
../IoUtil.cpp \
|
|
|
|
../Log.cpp \
|
2016-09-30 08:42:27 -05:00
|
|
|
../LOOLKit.cpp \
|
2016-05-01 11:35:42 -05:00
|
|
|
../LOOLProtocol.cpp \
|
2016-08-31 22:34:41 -05:00
|
|
|
../LOOLSession.cpp \
|
2016-05-01 11:35:42 -05:00
|
|
|
../TileCache.cpp \
|
|
|
|
../MessageQueue.cpp \
|
|
|
|
../Unit.cpp \
|
|
|
|
../Util.cpp
|
|
|
|
|
2016-10-21 06:29:18 -05:00
|
|
|
test_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS
|
2016-09-30 03:43:04 -05:00
|
|
|
test_SOURCES = TileCacheTests.cpp integration-http-server.cpp \
|
2016-09-28 15:04:51 -05:00
|
|
|
httpwstest.cpp httpcrashtest.cpp httpwserror.cpp test.cpp $(wsd_sources)
|
2016-04-11 12:21:16 -05:00
|
|
|
test_LDADD = $(CPPUNIT_LIBS)
|
2015-10-21 05:01:47 -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-04-05 11:41:10 -05:00
|
|
|
# unit test modules:
|
2016-11-17 11:34:52 -06:00
|
|
|
unit_requests_la_SOURCES = UnitRequests.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-13 09:10:02 -05:00
|
|
|
unit_fonts_la_SOURCES = UnitFonts.cpp
|
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-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
|
2016-06-16 06:45:20 -05:00
|
|
|
# FIXME unit-fonts.la is unstable, disabled for now.
|
2016-11-17 11:34:52 -06:00
|
|
|
TESTS = unit-tilecache.la unit-storage.la unit-timeout.la unit-prefork.la unit-admin.la unit-requests.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 ; }
|