diff options
author | Maarten Hoes <hoes.maarten@gmail.com> | 2014-11-10 14:13:17 -0500 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-12 10:02:41 +0000 |
commit | c7c4b1826622506637eae94dff907db98db3961b (patch) | |
tree | 891579d3f4187cf98fde8e4cad025871266d6764 | |
parent | f01d6c1c08cc21350f94bb8b121e6e5f4bd6761e (diff) |
Replaced hardcoded variable values with commandline options.
Change-Id: Iac7d0d21970c2276f529a098df16f8cbd41d3de7
Reviewed-on: https://gerrit.libreoffice.org/12352
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rwxr-xr-x | lcov-report/lcov-report.sh | 36 |
1 files changed, 33 insertions, 3 deletions
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" |