Merge branch 'feature/coverage'

[skip appveyor]
This commit is contained in:
Kogia-sima 2020-06-07 22:30:19 +09:00
commit 09ded92800
3 changed files with 29 additions and 1 deletions

View File

@ -22,4 +22,4 @@ env:
- RUST_BACKTRACE=1
script:
- cargo test --all-features --workspace
- bash ./scripts/travis.sh

View File

@ -8,6 +8,7 @@ Simple, small, and extremely fast template engine for Rust
[![Build status](https://ci.appveyor.com/api/projects/status/fa3et4rft4dyvdn9?svg=true)](https://ci.appveyor.com/project/Kogiasima/sailfish)
[![Version](https://img.shields.io/crates/v/sailfish)](https://crates.io/crates/sailfish)
[![docs](https://docs.rs/sailfish/badge.svg)](https://docs.rs/sailfish)
[![codecov](https://codecov.io/gh/Kogia-sima/sailfish/branch/master/graph/badge.svg)](https://codecov.io/gh/Kogia-sima/sailfish)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Kogia-sima/sailfish/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

27
scripts/travis.sh Normal file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -ex
export CARGO_OPTIONS="--all-features -p sailfish -p sailfish-compiler -p integration-tests"
if [ "$TRAVIS_RUST_VERSION" = "nightly" ] && [ -z "$TRAVIS_TAG" ]; then
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off -Copt-level=0"
wget https://github.com/mozilla/grcov/releases/download/v0.5.5/grcov-linux-x86_64.tar.bz2
tar xvf grcov-linux-x86_64.tar.bz2
wget https://github.com/Kogia-sima/rust-covfix/releases/download/v0.2.1/rust-covfix-linux-x86_64.tar.xz
tar xvf rust-covfix-linux-x86_64.tar.xz
mv rust-covfix-linux-x86_64/rust-covfix ./
fi
cargo build $CARGO_OPTIONS
cargo test $CARGO_OPTIONS
if [ "$TRAVIS_RUST_VERSION" = "nightly" ] && [ -z "$TRAVIS_TAG" ]; then
zip -0 ccov.zip `find . \( -name "sailfish*.gc*" -o -name "test-*.gc*" \) -print`
./grcov ccov.zip -s . -t lcov --llvm --ignore "/*" --ignore "integration-tests/*" -o lcov.info
sed -e 's/^SF:src\//SF:sailfish\/src\//' -i lcov.info
./rust-covfix lcov.info -o lcov.info
bash <(curl -s https://codecov.io/bash) -f lcov.info
fi