[Libreoffice-commits] buildbot.git: lcov-report/lcov-report.sh
Maarten Hoes
hoes.maarten at gmail.com
Wed Nov 12 02:03:00 PST 2014
lcov-report/lcov-report.sh | 36 +++++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
New commits:
commit c7c4b1826622506637eae94dff907db98db3961b
Author: Maarten Hoes <hoes.maarten at gmail.com>
Date: Mon Nov 10 14:13:17 2014 -0500
Replaced hardcoded variable values with commandline options.
Change-Id: Iac7d0d21970c2276f529a098df16f8cbd41d3de7
Reviewed-on: https://gerrit.libreoffice.org/12352
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/lcov-report/lcov-report.sh b/lcov-report/lcov-report.sh
index 2c8adcc..5adee75 100755
--- a/lcov-report/lcov-report.sh
+++ b/lcov-report/lcov-report.sh
@@ -7,9 +7,37 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-SRC_DIR=/home/buildslave/source/libo-core
-TRACEFILE_DIR=/home/buildslave/lcov
-HTML_DIR=/home/buildslave/lcov/html
+usage()
+{
+ echo "Usage: lcov-report.sh -s [DIRECTORY] -t [DIRECTORY] -w [DIRECTORY]
+ -s source code directory
+ -t tracefile directory
+ -w html (www) directory"
+ exit 1
+}
+
+if [ "$#" != "6" ]
+then
+ usage
+fi
+
+while getopts ":s:t:w:" opt
+do
+ case $opt in
+ s)
+ SRC_DIR="$OPTARG"
+ ;;
+ t)
+ TRACEFILE_DIR="$OPTARG"
+ ;;
+ w)
+ HTML_DIR="$OPTARG"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
if [ ! -d "$SRC_DIR" ]
then
@@ -23,12 +51,14 @@ mkdir "$TRACEFILE_DIR"
if [ "$?" != "0" ]
then
echo "ERROR: Failed to create directory $TRACEFILE_DIR" >&2
+ exit 1
fi
mkdir "$HTML_DIR"
if [ "$?" != "0" ]
then
echo "ERROR: Failed to create directory $HTML_DIR" >&2
+ exit 1
fi
lcov --zerocounters --directory "$SRC_DIR"
More information about the Libreoffice-commits
mailing list