]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Coveralls needs to access the Git repo
authorMartin Vidner <mvidner@suse.cz>
Thu, 23 Jan 2020 10:37:57 +0000 (11:37 +0100)
committerMartin Vidner <martin@vidner.net>
Thu, 23 Jan 2020 14:59:33 +0000 (15:59 +0100)
.travis.tumbleweed.sh
Makefile.am
Makefile.repo

index 93c01101e2e2538f743fd0ec46190f64fb65da77..ca96404b3fd625963bcb3b2c55ca42555c985b10 100755 (executable)
@@ -31,8 +31,11 @@ popd
 
 # Coverage report
 pushd /usr/src/packages/BUILD/snapper-*
-make coveralls STRIP_PATH_PREFIX="$(pwd)"
+make coverage
 popd
+# Must call coveralls-lcov from the git directory
+BUILDDIR=(/usr/src/packages/BUILD/snapper-*) # expand glob
+make -f Makefile.repo coveralls BUILDDIR="${BUILDDIR[@]}"
 
 # get the plain package names and remove all packages at once
 rpm -ev --nodeps `rpm -q --qf '%{NAME} ' -p /usr/src/packages/RPMS/**/*.rpm`
index 0610945ac079ed6d9465b0de970fd81ca1a2b8ee..696cc7935b5ccefb916c69bfa446ad2cabcc64af 100644 (file)
@@ -45,22 +45,14 @@ package-clean:
 
 if ENABLE_COVERAGE
 # Run `make coverage` after all the tests have been run.
+# See also make -f Makefile.repo coveralls
 COVERAGE_INFO = coverage/coverage.info
-.PHONY: coverage coveralls
+.PHONY: coverage
 coverage:
        mkdir -p $(dir $(COVERAGE_INFO))
        lcov --capture --no-external --exclude '*/testsuite*/*' --output-file $(COVERAGE_INFO) --directory .  --quiet
        lcov --list $(COVERAGE_INFO)
        genhtml --output-directory coverage --legend --title "Snapper code coverage" -q $(COVERAGE_INFO)
-
-coveralls: coverage
-       ## Strip the absolute path prefix from the coverage data
-       ## so coveralls.io can find the source files at GitHub.
-       ## STRIP_PATH_PREFIX should be set at 'make' time.
-       sed -i -e 's#^SF:'"$${STRIP_PATH_PREFIX}"'/\(.*\)#SF:\1#' "$(COVERAGE_INFO)"
-       ## Send the code coverage to coveralls.io
-       ## COVERALLS_TOKEN is set in Travis config and passed via .travis.yml
-       LC_ALL=en_US.UTF-8 coveralls-lcov --repo-token "$${COVERALLS_TOKEN}" "$(COVERAGE_INFO)"
 endif
 
 # Create all the files necessary for building the package with OBS:
index 7c2f6478e8e5b2a1ef8fea09f20bbb1526276db4..3cb6fba62354f8610a2545482aeced365ca4a040 100644 (file)
@@ -26,3 +26,15 @@ install: configure
 reconf: all
        ./config.status --recheck
        ./config.status
+
+# This needs access to the build (and test) results so you would expect it
+# in Makefile.am
+# But the coveralls tool needs info from the Git checkout.
+COVERAGE_INFO=$(BUILDDIR)/coverage/coverage.info
+coveralls:
+       # Strip the absolute path prefix from the coverage data
+       # so coveralls.io can find the source files at GitHub.
+       sed -i -e 's#^SF:'"$${BUILDDIR?}"'/\(.*\)#SF:\1#' "$(COVERAGE_INFO)"
+       # Send the code coverage to coveralls.io
+       # COVERALLS_TOKEN is set in Travis config and passed via .travis.yml
+       LC_ALL=en_US.UTF-8 coveralls-lcov --repo-token "$${COVERALLS_TOKEN}" "$(COVERAGE_INFO)"