about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorTimotej <timotej.kapus13@imperial.ac.uk>2015-06-15 18:30:00 +0100
committerTimotej <timotej.kapus13@imperial.ac.uk>2015-06-15 18:30:00 +0100
commita83176ef4494eede31ac00ecd7b0c40fcdd0feb0 (patch)
treeb0f031779aa3cc0a28e0a83b022f0bacb7be1cb8
parent6118403fa4315388946babd25be38a9524a5e2c5 (diff)
downloadklee-a83176ef4494eede31ac00ecd7b0c40fcdd0feb0.tar.gz
added zcov integration to travis CI
-rw-r--r--.travis.yml28
-rwxr-xr-x.travis/klee.sh32
2 files changed, 50 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml
index c971a801..413b5b9a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,23 +23,31 @@ env:
     #   UCLIBC: {ENABLED, DISABLED}
     # with Asserts enabled.
 
+    # COVERAGE set indicated that coverage data should be uplaoded to the server, only ONE job should have COVERAGE set
+
     # FIXME: Enable when we want to test LLVM3.5
+    matrix:
     #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
     #- LLVM_VERSION=3.5 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=2.9 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=2.9 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=3.4 STP_VERSION=r940 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=3.4 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
-    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1
+    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=1
+    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=UPSTREAM KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=3.4 STP_VERSION=r940 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=3.4 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=0 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
+    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=1 COVERAGE=0
 
     # Check at least one build with Asserts disabled.
-    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=1 ENABLE_OPTIMIZED=1
+    - LLVM_VERSION=2.9 STP_VERSION=r940 KLEE_UCLIBC=1 DISABLE_ASSERTIONS=1 ENABLE_OPTIMIZED=1 COVERAGE=0
 
     # Check at least one Debug+Asserts build
-    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=0
+    - LLVM_VERSION=3.4 STP_VERSION=UPSTREAM KLEE_UCLIBC=1 DISABLE_ASSERTIONS=0 ENABLE_OPTIMIZED=0 COVERAGE=0
+    global:
+    - secure: I2KHdohEIIBFHv8WuBPNP6Tr/KlF2bZsJaErSjyQgL6m0oNGI/f0AzTD+8lwlxhYSdk8Zq0+4R8uqKi9Hx70gN/Jxh2vpO+cStysP7IEpuUGojRleU5yxw0G8hDd8qvgqR23ZRBriIRQp+5h1AR/7cW1FJ62u5M5kbZMEJXe4wChSrERt6hhOY3aWvBaoJEfyUsKMPrtPVkTtnsbO/rdlaIJ8I7Eh0tGiI5aHzziVyA56CjEnDszEbbtTky0AIzPOUzL5rjsUNgEGkDk4KvyfGf8Fe8bd2Uucm1Bdx5l6Q2vF8ugwhClwF0kZCnBuZ8iY1f8fO8JAd91cRf5D4Yp+UYV7+xKRD3qEGerXz2riWWpJFTtcK8Jp4ZiPmguRqx5pSMjn8tM9u4I0a+QsttynX7juMgn4Hd7HmXXzDnUPCbbXOqUxH8E6hRyJsK9t1n2db8fiBZ82nAQI5Iia0bSS5Ugv3y8rmT8QunFmKe0E+VhN6BmNE/xp+dEYKkNJw9Q6z2HxzLcMmSDxYMSINXIHMahfh7hkL+4o2oM/8EN8+D5k+bWhes9qPqFQvG2EgeaObXwG0rgdnwMKqXwcVtM3rj1r9hkXyOiRIOpo9t2B82EBgBs8Wkn+a36jKl2ol7KO9BqKRr9VDBTNugyDT9Gb/s/p1DncfNrRRdHbtH6BV4=
+    - secure: YTSCtmz2/1vaaM9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uDRDW1gyMZN1AGO6ArdYoyPYhIQDRcYLtZt0qaM7hNjZ5iolSDXVk1OF/pjL+vNqiiPWb1EHxE/IRygeDca58EjSVJIr4LW+QwfjakRZtFqyqzrM8uAW0AfEQMOKdGA7YhRXNCg4/hkZMuAvO4daea5Xh8nbht2RQQ9r2hLfHbIgd4030aQnfk0HueNi3LVPkZDBmLM4OY/MOACZDFZQ1JLv+dg8wAblJ5NnLbLUg4pfEgCbZQICPW5j5xUqLqFFhwE4TYaTOjGsy+LkMdK0EasyPUwZhhs=
+
 cache: apt
 before_install:
     ###########################################################################
diff --git a/.travis/klee.sh b/.travis/klee.sh
index 3106dca9..9aa6b1af 100755
--- a/.travis/klee.sh
+++ b/.travis/klee.sh
@@ -55,6 +55,7 @@ ${KLEE_SRC}/configure --with-llvmsrc=/usr/lib/llvm-${LLVM_VERSION}/build \
             --with-llvmcxx=${KLEE_CXX} \
             --with-stp="${BUILD_DIR}/stp/build" \
             ${KLEE_UCLIBC_CONFIGURE_OPTION} \
+            CXXFLAGS="-fprofile-arcs -ftest-coverage" \
             && make DISABLE_ASSERTIONS=${DISABLE_ASSERTIONS} \
                     ENABLE_OPTIMIZED=${ENABLE_OPTIMIZED} \
                     ENABLE_SHARED=0
@@ -94,6 +95,37 @@ set +e # We want to let all the tests run before we exit
 lit -v .
 RETURN="${RETURN}$?"
 
+#generate and upload coverage if COVERAGE is set
+if [ ${COVERAGE} -eq 1 ]; then
+
+#get zcov that works with gcov v4.8
+    git clone https://github.com/kren1/zcov.git 
+    cd zcov
+    sudo python setup.py install
+    sudo mkdir /usr/local/lib/python2.7/dist-packages/zcov-0.3.0.dev0-py2.7.egg/zcov/js
+    cd zcov
+
+#these files are not where zcov expects them to be after install so we move them
+    sudo cp js/sorttable.js /usr/local/lib/python2.7/dist-packages/zcov-0.3.0.dev0-py2.7.egg/zcov/js/sorttable.js 
+    sudo cp js/sourceview.js /usr/local/lib/python2.7/dist-packages/zcov-0.3.0.dev0-py2.7.egg/zcov/js/sourceview.js 
+    sudo cp style.css /usr/local/lib/python2.7/dist-packages/zcov-0.3.0.dev0-py2.7.egg/zcov/style.css
+
+#install zcov dependency
+    sudo apt-get install enscript
+
+#update gcov from v4.6 to v4.8. This is becauase gcda files are made for v4.8 and cause 
+#a segmentation fault in v4.6
+    sudo apt-get install ggcov
+    sudo rm /usr/bin/gcov
+    sudo ln -s /usr/bin/gcov-4.8 /usr/bin/gcov
+
+#scan and generate coverage
+    zcov scan output.zcov ${BUILD_DIR}
+    zcov genhtml output.zcov coverage/
+#upload the coverage data, currently to a random ftp server
+    tar -zcvf coverage.tar.gz coverage/
+    curl --form "file=@coverage.tar.gz" -u ${USER}:${PASSWORD} ${COVERAGE_SERVER}
+fi
 ###############################################################################
 # Result
 ###############################################################################