summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Esser <besser82@fedoraproject.org>2020-02-07 17:41:04 +0100
committerBjörn Esser <besser82@fedoraproject.org>2020-02-07 18:23:19 +0100
commit7b767e8597ae3b86071292033c2b2eed6016fd15 (patch)
treeeb8e7923273653c18f044c6a0b7844c84ec929fb
parente1d17b83fd33b78262d9aad78225bc31153d847e (diff)
downloadlibxcrypt-7b767e8597ae3b86071292033c2b2eed6016fd15.tar.gz
libxcrypt-7b767e8597ae3b86071292033c2b2eed6016fd15.tar.bz2
libxcrypt-7b767e8597ae3b86071292033c2b2eed6016fd15.zip
TravisCI: Fix codecov data parsing on Linux with Clang.
LLVM has a fast development speed, and gcov cannot keep up maintaining full compatibility with it, we need to wrap the call to the 'gcov' utility, made by 'lcov'. Thus, we have to create a script '.clang_gcov_wrapper.sh', that calls the 'llvm-cov' utility in gcov mode to workaround the problem. Clang also needs some additional compiler flags.
-rwxr-xr-x.clang_gcov_wrapper.sh2
-rw-r--r--.travis.yml1
-rwxr-xr-x.travis_after_success.sh2
-rwxr-xr-x.travis_script.sh9
4 files changed, 12 insertions, 2 deletions
diff --git a/.clang_gcov_wrapper.sh b/.clang_gcov_wrapper.sh
new file mode 100755
index 0000000..4e320d8
--- /dev/null
+++ b/.clang_gcov_wrapper.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec llvm-cov gcov "$@"
diff --git a/.travis.yml b/.travis.yml
index 13f35bd..235a9b1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,7 @@ addons:
- gawk
- lcov
- libtool
+ - llvm
- pkg-config
- python3-venv
- valgrind
diff --git a/.travis_after_success.sh b/.travis_after_success.sh
index 731ae23..e608d64 100755
--- a/.travis_after_success.sh
+++ b/.travis_after_success.sh
@@ -16,6 +16,8 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$CC" == "gcc" ]] || [[ "$CC" == "gcc-$GCC_VER" ]]; then
export GCOV="gcov-$GCC_VER"
fi
+elif [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CC" == "clang" ]]; then
+ export GCOV="$PWD/.clang_gcov_wrapper.sh"
fi
. build/venv/bin/activate
diff --git a/.travis_script.sh b/.travis_script.sh
index bf88446..bf88218 100755
--- a/.travis_script.sh
+++ b/.travis_script.sh
@@ -98,7 +98,7 @@ fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export CFLAGS="-O2 -g -arch i386 -arch x86_64 --coverage"
export CXXFLAGS="$CFLAGS"
- export LDFLAGS="-arch i386 -arch x86_64"
+ export LDFLAGS="-arch i386 -arch x86_64 --coverage"
if [[ "$CC" == "gcc" ]]; then
GCC_VER="$(curl -s https://formulae.brew.sh/api/formula/gcc.json | jq -r '.versions.stable' | cut -d. -f1)"
export CC="gcc-$GCC_VER"
@@ -117,7 +117,12 @@ else
export CPPFLAGS="$(dpkg-buildflags --get CPPFLAGS)"
export CFLAGS="$(dpkg-buildflags --get CFLAGS) --coverage"
export CXXFLAGS="$(dpkg-buildflags --get CXXFLAGS) --coverage"
- export LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
+ export LDFLAGS="$(dpkg-buildflags --get LDFLAGS) --coverage"
+fi
+
+if [[ "$CC" == "clang" ]]; then
+ export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
+ export CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
fi
MAKE_ARGS=