[Libreoffice-commits] online.git: loolwsd/test

Michael Meeks michael.meeks at collabora.com
Sat Apr 30 17:16:09 UTC 2016


 loolwsd/test/Makefile.am     |    7 ++++---
 loolwsd/test/UnitPrefork.cpp |    3 ++-
 loolwsd/test/run_unit.sh.in  |   13 +++++--------
 3 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 012593e37593cfd7ae34ba5584ff05a0a99dda41
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Sat Apr 30 18:15:41 2016 +0100

    Unit test cleanups.

diff --git a/loolwsd/test/Makefile.am b/loolwsd/test/Makefile.am
index 7c26f38..7b64b9d 100644
--- a/loolwsd/test/Makefile.am
+++ b/loolwsd/test/Makefile.am
@@ -32,13 +32,14 @@ SYSTEM_STAMP =
 endif
 
 if HAVE_LO_PATH
-TESTS = unit-admin.la unit-timeout.la unit-fonts.la unit-storage.la unit-prefork.la run_test.sh
+check-local:
+	./run_unit.sh --log-file test.log --trs-file test.trs
+TESTS = unit-admin.la unit-timeout.la unit-fonts.la unit-storage.la unit-prefork.la
 else
 TESTS = ${top_builddir}/test/test
 endif
 
-TEST_EXTENSIONS = .la .sh
+TEST_EXTENSIONS = .la
 LA_LOG_DRIVER = ${top_srcdir}/test/run_unit.sh
-SH_LOG_DRIVER = ${top_srcdir}/test/run_unit.sh
 
 EXTRA_DIST = data/hello.odt data/hello.txt $(test_SOURCES) run_unit.sh
diff --git a/loolwsd/test/UnitPrefork.cpp b/loolwsd/test/UnitPrefork.cpp
index fc08e7c..ce67dd6 100644
--- a/loolwsd/test/UnitPrefork.cpp
+++ b/loolwsd/test/UnitPrefork.cpp
@@ -149,7 +149,8 @@ public:
     }
     ~UnitKitPrefork()
     {
-        fclose(_procSMaps);
+        if (_procSMaps)
+            fclose(_procSMaps);
     }
 
     virtual void launchedKit(int pid) override
diff --git a/loolwsd/test/run_unit.sh.in b/loolwsd/test/run_unit.sh.in
index f2daf63..072b3a8 100755
--- a/loolwsd/test/run_unit.sh.in
+++ b/loolwsd/test/run_unit.sh.in
@@ -11,6 +11,7 @@ enable_debug="@ENABLE_DEBUG@"
 jails_path="@JAILS_PATH@"
 lo_path="@LO_PATH@"
 
+tst=
 while test $# -gt 0; do
   case $1 in
       --test-name) tst=$2; shift;;
@@ -21,13 +22,8 @@ while test $# -gt 0; do
   shift
 done
 
-test_mode=
-if test "z$tst" != "zrun_test.sh"; then
-    # drop .la suffix
-    tst=`echo $tst | sed s/\.la//`;
-else
-    test_mode=old
-fi
+# drop .la suffix
+tst=`echo $tst | sed s/\.la//`;
 
 export LOOL_LOGLEVEL=trace
 
@@ -40,9 +36,10 @@ if test "z$enable_debug" != "ztrue"; then
 fi
 
 # result logging
+echo "test output is '$test_output'"
 echo > $test_output
 
-if test "z$test_mode" == "zold"; then
+if test "z$tst" == "z"; then
      echo "executing external tests"
      ${abs_top_builddir}/loolwsd --systemplate="$systemplate_path" \
                                  --lotemplate="$lo_path" \


More information about the Libreoffice-commits mailing list