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 = \
|
2017-08-09 15:02:29 -05:00
|
|
|
unit-timeout.la unit-prefork.la \
|
|
|
|
unit-storage.la unit-client.la \
|
|
|
|
unit-admin.la unit-tilecache.la \
|
2017-09-27 07:13:43 -05:00
|
|
|
unit-fuzz.la unit-oob.la unit-oauth.la \
|
2018-02-08 08:24:37 -06:00
|
|
|
unit-wopi.la unit-wopi-saveas.la \
|
2018-02-08 12:51:54 -06:00
|
|
|
unit-wopi-ownertermination.la unit-wopi-versionrestore.la \
|
|
|
|
unit-wopi-documentconflict.la
|
2018-02-08 08:24:37 -06:00
|
|
|
|
2016-04-05 11:41:10 -05:00
|
|
|
|
2016-04-14 12:46:32 -05:00
|
|
|
MAGIC_TO_FORCE_SHLIB_CREATION = -rpath /dummy
|
2017-03-31 04:12:10 -05:00
|
|
|
AM_LDFLAGS = -pthread -module $(MAGIC_TO_FORCE_SHLIB_CREATION) $(ZLIB_LIBS)
|
2016-09-28 14:07:07 -05:00
|
|
|
|
2018-05-04 11:47:33 -05:00
|
|
|
if ENABLE_SSL
|
|
|
|
AM_LDFLAGS += -lssl -lcrypto
|
|
|
|
endif
|
|
|
|
|
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 \
|
2017-03-30 12:14:40 -05:00
|
|
|
../common/Util.cpp \
|
2016-12-10 21:33:45 -06:00
|
|
|
../common/MessageQueue.cpp \
|
2016-11-24 08:56:06 -06:00
|
|
|
../kit/Kit.cpp \
|
2017-08-16 09:38:00 -05:00
|
|
|
../wsd/Auth.cpp \
|
2016-11-24 08:56:06 -06:00
|
|
|
../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
|
|
|
../net/Socket.cpp
|
2016-05-01 11:35:42 -05:00
|
|
|
|
2018-05-04 11:47:33 -05:00
|
|
|
if ENABLE_SSL
|
|
|
|
wsd_sources += ../net/Ssl.cpp
|
|
|
|
endif
|
|
|
|
|
2017-09-19 15:16:44 -05:00
|
|
|
test_base_source = \
|
|
|
|
TileQueueTests.cpp \
|
|
|
|
WhiteBoxTests.cpp \
|
2017-09-16 11:32:20 -05:00
|
|
|
DeltaTests.cpp \
|
2017-09-19 15:16:44 -05:00
|
|
|
$(wsd_sources)
|
|
|
|
|
|
|
|
test_all_source = \
|
|
|
|
$(test_base_source) \
|
|
|
|
TileCacheTests.cpp \
|
|
|
|
integration-http-server.cpp \
|
|
|
|
httpwstest.cpp \
|
|
|
|
httpcrashtest.cpp \
|
|
|
|
httpwserror.cpp
|
|
|
|
|
2016-09-30 03:43:04 -05:00
|
|
|
unittest_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS
|
2017-09-19 15:16:44 -05:00
|
|
|
unittest_SOURCES = $(test_base_source) test.cpp
|
2016-09-30 03:43:04 -05:00
|
|
|
unittest_LDADD = $(CPPUNIT_LIBS)
|
|
|
|
|
2016-12-17 08:54:19 -06:00
|
|
|
test_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS
|
2017-09-19 15:16:44 -05:00
|
|
|
test_SOURCES = $(test_all_source) test.cpp
|
2016-12-17 08:54:19 -06:00
|
|
|
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)
|
2017-09-19 13:06:46 -05:00
|
|
|
unit_client_la_SOURCES = UnitClient.cpp ${test_all_source}
|
2017-05-11 21:08:20 -05:00
|
|
|
unit_client_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
|
2017-08-03 16:05:48 -05:00
|
|
|
unit_oauth_la_SOURCES = UnitOAuth.cpp
|
|
|
|
unit_oauth_la_LIBADD = $(CPPUNIT_LIBS)
|
2017-09-27 07:13:43 -05:00
|
|
|
unit_wopi_la_SOURCES = UnitWOPI.cpp
|
|
|
|
unit_wopi_la_LIBADD = $(CPPUNIT_LIBS)
|
2017-10-20 11:12:05 -05:00
|
|
|
unit_wopi_saveas_la_SOURCES = UnitWOPISaveAs.cpp
|
|
|
|
unit_wopi_saveas_la_LIBADD = $(CPPUNIT_LIBS)
|
2018-02-01 22:28:20 -06:00
|
|
|
unit_wopi_ownertermination_la_SOURCES = UnitWopiOwnertermination.cpp
|
|
|
|
unit_wopi_ownertermination_la_LIBADD = $(CPPUNIT_LIBS)
|
2018-02-08 08:24:37 -06:00
|
|
|
unit_wopi_versionrestore_la_SOURCES = UnitWOPIVersionRestore.cpp
|
|
|
|
unit_wopi_versionrestore_la_LIBADD = $(CPPUNIT_LIBS)
|
2018-02-08 12:51:54 -06:00
|
|
|
unit_wopi_documentconflict_la_SOURCES = UnitWOPIDocumentConflict.cpp
|
|
|
|
unit_wopi_documentconflict_la_LIBADD = $(CPPUNIT_LIBS)
|
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:
|
2017-04-05 08:44:44 -05:00
|
|
|
@fc-cache "@LO_PATH@"/share/fonts/truetype
|
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&) ,
|
2018-02-08 12:51:54 -06:00
|
|
|
TESTS = unit-prefork.la unit-tilecache.la unit-timeout.la \
|
|
|
|
unit-oauth.la unit-wopi.la unit-wopi-saveas.la \
|
|
|
|
unit-wopi-ownertermination.la unit-wopi-versionrestore.la \
|
|
|
|
unit-wopi-documentconflict.la
|
2017-09-19 13:06:46 -05:00
|
|
|
# TESTS = unit-client.la
|
2017-09-19 15:16:44 -05:00
|
|
|
# TESTS += unit-admin.la
|
|
|
|
# TESTS += unit-storage.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
|
|
|
|
|
2018-03-07 06:48:56 -06:00
|
|
|
EXTRA_DIST = data/delta-text.png data/delta-text2.png data/hello.odt data/hello.txt $(test_SOURCES) $(unittest_SOURCES) run_unit.sh
|
2016-05-12 17:40:59 -05:00
|
|
|
|
|
|
|
check_valgrind: all
|
2017-04-05 08:44:44 -05:00
|
|
|
@fc-cache "@LO_PATH@"/share/fonts/truetype
|
2016-05-12 17:40:59 -05:00
|
|
|
./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
|
2017-04-05 08:44:44 -05:00
|
|
|
@fc-cache "@LO_PATH@"/share/fonts/truetype
|
2017-08-17 07:04:22 -05:00
|
|
|
@${top_builddir}/test/unittest
|