CodeChain-io / codechain

CodeChain's official implementation in Rust.
https://codechain.io/
GNU Affero General Public License v3.0
258 stars 51 forks source link

Needs code coverage evaluation #1685

Open HoOngEe opened 5 years ago

HoOngEe commented 5 years ago

codechain needs code coverage evaluation before releasing version 2.0 Firstly, we need to investigate the coverage measuring tool.

HoOngEe commented 5 years ago

kcov does not help and the repository is too old.

HoOngEe commented 5 years ago

tarpaulin is much better. Even though the cargo test --all passes successfully, tarpaulin gives error like

test consensus::validator_set::dynamic_validator::tests::validator_set ... Error: "Failed to get test coverage! Error: Failed to run tests: A segfault occurred while executing tests"
HoOngEe commented 5 years ago

grcov finally works with

RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads" cargo +nightly test --all;
zip -0 ccov.zip `find . \( -name "codechain*.gc*" \) -print`;
grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir "/*" -o lcov.info;

It reported 스크린샷, 2019-08-02 18-54-47

HoOngEe commented 5 years ago

But still It counts test functions' lines, I need to study more about ignore test functions from counting.