diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-23 16:46:09 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-23 17:36:20 -0700 |
commit | c6256de2e8471e8f93fcefada5ec4b073277c2da (patch) | |
tree | c8968d8ecb7a1886456815890e540ce7bdac8d2c /scripts | |
parent | f38f58f758f54aeeb667c3e029b96fb43ada7892 (diff) | |
download | qtlocation-mapboxgl-c6256de2e8471e8f93fcefada5ec4b073277c2da.tar.gz |
[build] Avoid variable name coupling between main.mk and collect-coverage.sh
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/collect-coverage.sh | 18 | ||||
-rw-r--r-- | scripts/main.mk | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/scripts/collect-coverage.sh b/scripts/collect-coverage.sh index 2e8ad9550b..35a9b8cd5a 100755 --- a/scripts/collect-coverage.sh +++ b/scripts/collect-coverage.sh @@ -8,6 +8,8 @@ if [ -z ${ENABLE_COVERAGE} ] ; then exit 1 fi +directory=$1 + function usage() { echo "Error: LCOV and genhtml are required for generating coverage reports." if [ `uname -s` = 'Linux' ]; then @@ -25,8 +27,8 @@ command -v genhtml >/dev/null 2>&1 || usage lcov \ --quiet \ --zerocounters \ - --directory "build/${PLATFORM_SLUG}/${BUILDTYPE}" \ - --output-file "build/${PLATFORM_SLUG}/${BUILDTYPE}/coverage.info" \ + --directory "${directory}" \ + --output-file "${directory}/coverage.info" \ >/dev/null 2>&1 # Run all unit tests @@ -41,9 +43,9 @@ lcov \ --directory "src/mbgl" \ --directory "platform" \ --directory "include/mbgl" \ - --directory "build/${PLATFORM_SLUG}/${BUILDTYPE}" \ - --base-directory "build/${PLATFORM_SLUG}/${BUILDTYPE}" \ - --output-file "build/${PLATFORM_SLUG}/${BUILDTYPE}/coverage.info" \ + --directory "${directory}" \ + --base-directory "${directory}" \ + --output-file "${directory}/coverage.info" \ >/dev/null 2>&1 # Generate HTML report based on coverage.info @@ -59,8 +61,8 @@ genhtml \ --sort \ --demangle-cpp \ --prefix $(pwd -P) \ - --output-directory "build/${PLATFORM_SLUG}/${BUILDTYPE}/coverage" \ - "build/${PLATFORM_SLUG}/${BUILDTYPE}/coverage.info" \ + --output-directory "${directory}/coverage" \ + "${directory}/coverage.info" \ >/dev/null 2>&1 -echo "Coverage report is now available in build/${PLATFORM_SLUG}/${BUILDTYPE}/coverage/index.html" +echo "Coverage report is now available in ${directory}/coverage/index.html" diff --git a/scripts/main.mk b/scripts/main.mk index bc7506db5c..bb18411d56 100644 --- a/scripts/main.mk +++ b/scripts/main.mk @@ -163,4 +163,4 @@ test-%: Makefile/test $(GDB) $(PLATFORM_OUTPUT)/$(BUILDTYPE)/test --gtest_catch_exceptions=0 --gtest_filter=$* check: Makefile/test - ./scripts/collect-coverage.sh + ./scripts/collect-coverage.sh $(PLATFORM_OUTPUT)/$(BUILDTYPE) |