Просмотр исходного кода

send coverage results to coveralls

Steffen Jaeckel 11 лет назад
Родитель
Сommit
1a44e2d22d
2 измененных файлов с 28 добавлено и 0 удалено
  1. 2 0
      .travis.yml
  2. 26 0
      coverage.sh

+ 2 - 0
.travis.yml

@@ -3,6 +3,7 @@ compiler:
   - gcc
 script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/libtommath.a"
 env:
+  - BUILDSCRIPT="coverage.sh"   BUILDNAME="COVERAGE"                    BUILDOPTIONS=" "
   - BUILDSCRIPT="run.sh"        BUILDNAME="STOCK"                       BUILDOPTIONS=" "
   - BUILDSCRIPT="run.sh"        BUILDNAME="SMALL"                       BUILDOPTIONS="-DLTC_SMALL_CODE"
   - BUILDSCRIPT="run.sh"        BUILDNAME="NOTABLES"                    BUILDOPTIONS="-DLTC_NO_TABLES"
@@ -23,6 +24,7 @@ branches:
     - develop
 before_script:
   - sudo apt-get install libtommath-dev
+  - sudo pip install cpp-coveralls
 after_failure:
   - cat test_std.txt
   - cat test_err.txt

+ 26 - 0
coverage.sh

@@ -0,0 +1,26 @@
+#!/bin/bash
+
+if [ -z "$(echo $CC | grep "gcc")" ]; then
+    echo "no gcc detected, early exit success"
+    exit 0
+fi
+
+# output version
+bash printinfo.sh
+
+bash build.sh " $1" " $2" " $3 " "$4 -fprofile-arcs -ftest-coverage " "$5 -lgcov"
+if [ -a testok.txt ] && [ -f testok.txt ]; then
+   echo
+else
+	echo
+	echo "Test failed"
+	exit 1
+fi
+
+cpp-coveralls
+
+exit 0
+
+# $Source$
+# $Revision$
+# $Date$