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

Commit

Permalink
Fixing conditional coverage testing
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Apr 3, 2018
1 parent c383e47 commit 7de58e3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,8 @@ addons:
- binutils-dev
- libiberty-dev

after_success: |
TARGET=$HOME/kcov &&
export PATH=$TARGET/bin:$PATH &&
for file in target/debug/rsbx-*; do if [[ $file == *.d ]]; then continue; fi; kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"; done &&
wget https://codecov.io/bash -O codecov_uploader &&
chmod u+x codecov_uploader &&
./codecov_uploader -s "target/cov/rsbx" &&
echo "Uploaded code coverage to Codecov" &&
for file in target/debug/rsbx-*; do if [[ $file == *.d ]]; then continue; fi; kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"; done &&
echo "Uploaded code coverage to Coveralls"
after_success:
- bash kcov_run_tests_and_upload_reports.sh

before_deploy:
- sh ci/before_deploy.sh
Expand Down
34 changes: 34 additions & 0 deletions kcov_run_tests_and_upload_reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

if [[ $TARGET != x86_64-unknown-linux-gnu ]]; then
exit 0
fi

export PATH=$HOME/kcov/bin:$PATH

for file in target/debug/rsbx-*; do
if [[ $file == *.d ]]; then
continue
fi

kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"
done

wget https://codecov.io/bash -O codecov_uploader
chmod u+x codecov_uploader

./codecov_uploader -s "target/cov/rsbx"

echo "Uploaded code coverage to Codecov"

for file in target/debug/rsbx-*; do
if [[ $file == *.d ]]; then
continue
fi

kcov --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/rsbx" "$file"
done

echo "Uploaded code coverage to Coveralls"

exit 0

0 comments on commit 7de58e3

Please sign in to comment.