[Libreoffice-commits] online.git: loolwsd/Makefile.am loolwsd/test
Jan Holesovsky
kendy at collabora.com
Fri Sep 30 08:45:43 UTC 2016
loolwsd/Makefile.am | 5 ++++-
loolwsd/test/Makefile.am | 22 +++++++++++++++++++---
2 files changed, 23 insertions(+), 4 deletions(-)
New commits:
commit 0b5fa973da715bd5e5539ce953628ca15e45c8cf
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Sep 30 10:43:04 2016 +0200
Run unit tests (that don't require loolwsd) during the build time.
Change-Id: I2b1ea4fb5e6dcd8e4eb5f3890507f541c1457b39
diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am
index fa6c3a0..295d120 100644
--- a/loolwsd/Makefile.am
+++ b/loolwsd/Makefile.am
@@ -180,10 +180,13 @@ clang-tidy:
# installing the RPM or Debian package.
all-local: loolforkit @JAILS_PATH@ $(SYSTEM_STAMP)
- if test "$$BUILDING_FROM_RPMBUILD" != yes; then \
+ @if test "$$BUILDING_FROM_RPMBUILD" != yes; then \
sudo @SETCAP@ cap_fowner,cap_mknod,cap_sys_chroot=ep loolforkit; \
sudo @SETCAP@ cap_sys_admin=ep loolmount; \
echo "Set required capabilities"; \
else \
echo "Skipping capability setting"; \
fi
+
+# just run the build without any tests
+build-nocheck: all-am
diff --git a/loolwsd/test/Makefile.am b/loolwsd/test/Makefile.am
index cf255d9..5cc993e 100644
--- a/loolwsd/test/Makefile.am
+++ b/loolwsd/test/Makefile.am
@@ -2,8 +2,14 @@
export MAX_CONCURRENCY=4
AUTOMAKE_OPTION = serial-tests
+# unittest: tests that do not need loolwsd running, and that are run during a
+# normal build
+bin_PROGRAMS = unittest
+
+# unittest: tests that need loolwsd running, and that are run via 'make check'
check_PROGRAMS = test
-noinst_PROGRAMS = test
+
+noinst_PROGRAMS = test unittest
AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
@@ -33,10 +39,14 @@ wsd_sources = \
../Util.cpp
test_CPPFLAGS = -DTDOC=\"$(abs_top_srcdir)/test/data\" -I$(top_srcdir) -DBUILDING_TESTS
-test_SOURCES = TileCacheTests.cpp TileQueueTests.cpp WhiteBoxTests.cpp integration-http-server.cpp \
+test_SOURCES = TileCacheTests.cpp integration-http-server.cpp \
httpwstest.cpp httpcrashtest.cpp httpwserror.cpp test.cpp $(wsd_sources)
test_LDADD = $(CPPUNIT_LIBS)
+unittest_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS
+unittest_SOURCES = TileQueueTests.cpp WhiteBoxTests.cpp test.cpp $(wsd_sources)
+unittest_LDADD = $(CPPUNIT_LIBS)
+
# unit test modules:
unit_fuzz_la_SOURCES = UnitFuzz.cpp
unit_admin_la_SOURCES = UnitAdmin.cpp
@@ -67,8 +77,14 @@ endif
TEST_EXTENSIONS = .la
LA_LOG_DRIVER = ${top_srcdir}/test/run_unit.sh
-EXTRA_DIST = data/hello.odt data/hello.txt $(test_SOURCES) run_unit.sh
+EXTRA_DIST = data/hello.odt data/hello.txt $(test_SOURCES) $(unittest_SOURCES) run_unit.sh
check_valgrind: all
./run_unit.sh --log-file test.log --trs-file test.trs --valgrind
+# 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
+ @${top_builddir}/test/unittest 2> unittest.log || cat unittest.log
More information about the Libreoffice-commits
mailing list