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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Fri May 13 12:56:45 UTC 2016


 loolwsd/test/Makefile.am    |    4 ++++
 loolwsd/test/run_unit.sh.in |    8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 13469e45cb990f163e07d35aba6cdb5f11028a1e
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Thu May 12 18:40:59 2016 -0400

    loolwsd: new check_valgrind target to run tests under valgrind
    
    Change-Id: I1aa6d2f7435f4398111af09a4e9ddc6e300cf280
    Reviewed-on: https://gerrit.libreoffice.org/24966
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/test/Makefile.am b/loolwsd/test/Makefile.am
index c36cc2a..a447097 100644
--- a/loolwsd/test/Makefile.am
+++ b/loolwsd/test/Makefile.am
@@ -56,3 +56,7 @@ 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
+
+check_valgrind: all
+	./run_unit.sh --log-file test.log --trs-file test.trs --valgrind
+
diff --git a/loolwsd/test/run_unit.sh.in b/loolwsd/test/run_unit.sh.in
index 1d590b1..20b4ae7 100755
--- a/loolwsd/test/run_unit.sh.in
+++ b/loolwsd/test/run_unit.sh.in
@@ -10,6 +10,7 @@ systemplate_path="@SYSTEMPLATE_PATH@"
 enable_debug="@ENABLE_DEBUG@"
 jails_path="@JAILS_PATH@"
 lo_path="@LO_PATH@"
+valgrind_cmd="valgrind --tool=memcheck --trace-children=no -v --read-var-info=yes"
 
 # run the test on a dedicated port
 # TODO when we update test execution that the tests run in parallel, we'll
@@ -23,6 +24,7 @@ while test $# -gt 0; do
       --test-name) tst=$2; shift;;
       --log-file)  tst_log=$2; shift;;
       --trs-file)  test_output=$2; shift;;
+      --valgrind)  valgrind=$valgrind_cmd; shift;;
   -*) ;; # ignore
   esac
   shift
@@ -47,6 +49,7 @@ echo > $test_output
 
 if test "z$tst" == "z"; then
      echo "executing external tests"
+     ${valgrind} \
      ${abs_top_builddir}/loolwsd --systemplate="$systemplate_path" \
                                  --lotemplate="$lo_path" \
                                  --childroot="$jails_path" \
@@ -56,7 +59,7 @@ if test "z$tst" == "z"; then
 
      oldpath=`pwd`
      cd "${abs_top_builddir}/test"
-     if ./test; then
+     if ${valgrind} ./test; then
 	 echo "Test run_test.sh passed."
 	 echo ":test-result: PASS run_test.sh" >> $oldpath/$test_output
 	 retval=0
@@ -74,7 +77,8 @@ if test "z$tst" == "z"; then
 
 else # newer unit tests.
     echo "Running $tst | $tst_log ...";
-    if ${abs_top_builddir}/loolwsd --systemplate="$systemplate_path" \
+	if ${valgrind} \
+        ${abs_top_builddir}/loolwsd --systemplate="$systemplate_path" \
                                    --lotemplate="$lo_path" \
                                    --childroot="$jails_path" \
                                    --allowlocalstorage \


More information about the Libreoffice-commits mailing list