Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Fixing travis-ci code coverage test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Apr 1, 2018
1 parent 054180c commit e41d18d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
19 changes: 6 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ branches:
script:
- cargo build --verbose --all
- cargo test --verbose --all
- bash tests/dev_tests.sh
- bash install_kcov.sh
- bash cov_tests/dev_tests.sh
- bash tests/dev_tests.sh

env:
global:
Expand All @@ -32,18 +33,10 @@ addons:
sudo: required

after_success: |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
make install DESTDIR=../../kcov-build &&
cd ../.. &&
rm -rf kcov-master &&
for file in target/debug/rsbx*; do if [[ $file == *.d ]]; then continue; fi; mkdir -p "target/cov/rsbx"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"; done &&
TARGET=$HOME/kcov &&
export PATH=$TARGET/bin:$PATH &&
for file in target/debug/rsbx*; do if [[ $file == *.d ]]; then continue; fi; mkdir -p "target/cov/rsbx"; kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"; done &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage to Codecov" &&
for file in target/debug/rsbx*; do if [[ $file == *.d ]]; then continue; fi; mkdir -p "target/cov/rsbx"; ./kcov-build/usr/local/bin/kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"; done &&
for file in target/debug/rsbx*; do if [[ $file == *.d ]]; then continue; fi; mkdir -p "target/cov/rsbx"; kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"; done &&
echo "Uploaded code coverage to Coveralls"
10 changes: 9 additions & 1 deletion cov_tests/kcov_rsbx_fun.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

TARGET=$HOME/kcov

export PATH=$TARGET/bin:$PATH

function kcov_rsbx() {
kcov --exclude-pattern=/.cargo,/usr/lib --verify "../target/cov/rsbx" rsbx "$@"
if [[ $TRAVIS == true ]]; then

else
kcov --exclude-pattern=/.cargo,/usr/lib --verify "../target/cov/rsbx" rsbx "$@"
fi
}
16 changes: 16 additions & 0 deletions install_kcov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e
shopt -s nullglob

TARGET=$HOME/kcov

wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
tar xzf master.tar.gz
cd kcov-master
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$TARGET
make
make install
cd ../..

0 comments on commit e41d18d

Please sign in to comment.