]> granicus.if.org Git - libatomic_ops/commitdiff
Travis CI: Report test coverage for Linux/x64 (native CPU)
authorIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jan 2017 19:13:44 +0000 (22:13 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jan 2017 19:20:01 +0000 (22:20 +0300)
.travis.yml

index d078c9b4934fdadc131f67900e68a0aa4efe6743..30fbb7005b2852cd0aeec44324692415c9c7d0c1 100644 (file)
@@ -12,21 +12,33 @@ env:
   - CFLAGS_EXTRA=
   - CFLAGS_EXTRA=-march=native
   - CFLAGS_EXTRA="-m32 -march=native"
+  - CFLAGS_EXTRA="--coverage -march=native"
 
 matrix:
   exclude:
   - os: osx
     compiler: gcc
+  - compiler: clang
+    env: CFLAGS_EXTRA="--coverage -march=native"
+  - os: linux
+    compiler: gcc
+    env: CFLAGS_EXTRA=-march=native
 
 sudo: required
 
 before_install:
   - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CFLAGS_EXTRA" == -m32* ]]; then sudo apt-get install libc6:i386 libc6-dev-i386; fi
+  - if [[ "$CFLAGS_EXTRA" == --coverage* ]]; then sudo apt-get install lcov; gem install coveralls-lcov; ENABLE_GCOV=--enable-gcov; CFLAGS_EXTRA="-march=native"; fi
 
 install:
   - ./autogen.sh
-  - ./configure --enable-assertions --enable-werror
+  - ./configure --enable-assertions $ENABLE_GCOV --enable-werror
 
 script:
   - make -j check CFLAGS_EXTRA="$CFLAGS_EXTRA"
   - cat tests/test_atomic*.log
+
+after_success:
+  - if [[ "$ENABLE_GCOV" == "--enable-gcov" ]]; then lcov --directory src --capture --output-file coverage.info; fi
+  - if [[ "$ENABLE_GCOV" == "--enable-gcov" ]]; then lcov --remove coverage.info 'tests/*' --output-file coverage.info && lcov --list coverage.info; fi
+  - if [[ "$ENABLE_GCOV" == "--enable-gcov" ]]; then coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info; fi