[Libreoffice-commits] dev-tools.git: lcov/coverage.sh
Miklos Vajna
vmiklos at suse.cz
Mon Apr 8 05:56:07 PDT 2013
lcov/coverage.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
New commits:
commit 366d589fb958b6f98fda590071d0027303cda858
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Apr 8 14:50:59 2013 +0200
import initial lcov coverage script
Change-Id: Id41c071c20969ff309c9acde1d6e48a9726cfe30
diff --git a/lcov/coverage.sh b/lcov/coverage.sh
new file mode 100755
index 0000000..ce8c300
--- /dev/null
+++ b/lcov/coverage.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# Run this script in the toplevel directory of a LibreOffice checkout.
+
+coverage()
+{
+ srcmodule="$1"
+ srcdir="$2"
+ srcfiles="$3"
+ testmodule="$4"
+ tests="$5"
+
+ set -ex
+ rm -rf workdir/*/CxxObject/$srcmodule/$srcdir/$srcfiles.{gcda,gcno} libreoffice.info coverage
+ cd $srcmodule
+ touch $srcdir/$srcfiles
+ make -sr -j$parallelism gb_GCOV=YES
+ cd ../$testmodule
+ make -sr -j$parallelism $tests
+ cd ..
+ lcov --directory workdir/*/CxxObject/$srcmodule/$srcdir --capture --output-file libreoffice.info
+ genhtml -o coverage libreoffice.info
+}
+
+parallelism=$(make -s cmd cmd='echo $(CHECK_PARALLELISM)'|tail -n 1)
+
+case "$1" in
+ sw_rtfimport)
+ # Writer RTF import
+ coverage writerfilter source/rtftok '*' sw 'CppunitTest_sw_rtfimport CppunitTest_sw_rtfexport'
+ ;;
+ sw_rtfexport)
+ # Writer RTF export
+ coverage sw source/filter/ww8 'rtf*' sw CppunitTest_sw_rtfexport
+ ;;
+ *)
+ echo "Unknown code area. The currently supported ones are:"
+ echo
+ echo "sw_rtfexport"
+ echo "sw_rtfimport"
+ ;;
+esac
+
+# vi:set shiftwidth=4 expandtab:
More information about the Libreoffice-commits
mailing list