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

Commit

Permalink
test(coverage): generat test coverage with kcov and publish it on cod…
Browse files Browse the repository at this point in the history
…ecov.io
  • Loading branch information
bochaco committed Apr 11, 2019
1 parent 21781d1 commit 0a3f0a4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 11 deletions.
51 changes: 43 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@ env:
language: rust
rust:
- 1.32.0
os:
- linux
- osx
- windows

# necessary for `travis-cargo coveralls --no-sudo`
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- binutils-dev
- libiberty-dev

matrix:
include:
- os: linux
- os: osx
- os: windows
env:
- YARN_GPG=no # otherwise this starts gpg-agent that never exits

sudo: false
cache:
Expand All @@ -22,12 +38,31 @@ cache:
before_script:
- curl -sSL https://github.com/maidsafe/QA/raw/master/travis/cargo_install.sh > cargo_install.sh
- bash cargo_install.sh cargo-prune;
- PKGNAME="safe_auth" # must match with cargo.toml

before_cache:
- cargo prune

install :
- cargo check --release
install:
- cargo check

script:
- cargo test

script :
- cargo test --release
after_success:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build &&
cmake .. && make &&
make install DESTDIR=../../kcov-build && cd ../.. &&
rm -rf kcov-master && rm master.tar.gz &&
for file in target/debug/$PKGNAME-*; do \
[ -x "${file}" ] || continue; \
echo "Calculating coverage of ${file}..."
mkdir -p "target/cov/$(basename $file)"; \
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; \
done &&
bash <(curl -s https://codecov.io/bash) -t 6bfd35b4-f75a-4e20-b656-f2a07838976f &&
echo "Uploaded code coverage to codecov.io";
fi
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
|Documentation|Linux/macOS/Windows|
|:-----------:|:-----------------:|
| [![Documentation](https://docs.rs/safe-authenticator-cli/badge.svg)](https://docs.rs/safe-authenticator-cli) | [![Build Status](https://travis-ci.com/maidsafe/safe-authenticator-cli.svg?branch=master)](https://travis-ci.com/maidsafe/safe-authenticator-cli) |
|Documentation|Linux/macOS/Windows|Coverage Status|
|:-----------:|:-----------------:|:-------------:|
| [![Documentation](https://docs.rs/safe-authenticator-cli/badge.svg)](https://docs.rs/safe-authenticator-cli) | [![Build Status](https://travis-ci.com/maidsafe/safe-authenticator-cli.svg?branch=master)](https://travis-ci.com/maidsafe/safe-authenticator-cli) | [![Coverage Status](https://codecov.io/gh/maidsafe/safe-authenticator-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/maidsafe/safe-authenticator-cli) |

| [MaidSafe website](https://maidsafe.net) | [SAFE Dev Forum](https://forum.safedev.org) | [SAFE Network Forum](https://safenetforum.org) |
|:----------------------------------------:|:-------------------------------------------:|:----------------------------------------------:|


# SAFE Authenticator CLI
This crate implements a CLI (Command Line Interface) for the [safe_authenticator](https://github.com/maidsafe/safe_client_libs/tree/master/safe_authenticator) crate.

Expand Down

0 comments on commit 0a3f0a4

Please sign in to comment.