From b381bc6f489b76b9986161f14fea0948a67b8769 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Tue, 16 Jun 2015 01:26:11 +0300 Subject: [PATCH] Script Coverage --- getcoverage.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/getcoverage.sh b/getcoverage.sh index ac50bf94b..8d34d733c 100755 --- a/getcoverage.sh +++ b/getcoverage.sh @@ -10,35 +10,37 @@ then fi OUTPUT_DIR="$CPP_ETHEREUM_PATH/build/test/coverage" -TESTETH=$CPP_ETHEREUM_PATH/build #/test/CMakeFiles/testeth.dir +TESTETH=$CPP_ETHEREUM_PATH/build if which lcov >/dev/null; then if which genhtml >/dev/null; then - lcov --directory $TESTETH --zerocounters - echo Running testeth... - $CPP_ETHEREUM_PATH/build/test/testeth -t --all - $CPP_ETHEREUM_PATH/build/test/testeth -t StateTests --jit --all - $CPP_ETHEREUM_PATH/build/test/testeth -t VMTests --jit --all - echo Prepearing coverage info... + echo Cleaning previous report... + if [ -d "$OUTPUT_DIR" ]; then + rm -r $OUTPUT_DIR + fi + mkdir $OUTPUT_DIR + lcov --directory $TESTETH --zerocounters + lcov --capture --initial --directory $TESTETH --output-file $OUTPUT_DIR/coverage_base.info + + echo Running testeth... + $CPP_ETHEREUM_PATH/build/test/testeth --all + $CPP_ETHEREUM_PATH/build/test/testeth -t StateTests --jit --all + $CPP_ETHEREUM_PATH/build/test/testeth -t VMTests --jit --all + + echo Prepearing coverage info... + lcov --capture --directory $TESTETH --output-file $OUTPUT_DIR/coverage_test.info + lcov --add-tracefile $OUTPUT_DIR/coverage_base.info --add-tracefile $OUTPUT_DIR/coverage_test.info --output-file $OUTPUT_DIR/coverage_all.info + lcov --extract $OUTPUT_DIR/coverage_all.info *cpp-ethereum/* --output-file $OUTPUT_DIR/coverage_export.info + genhtml $OUTPUT_DIR/coverage_export.info --output-directory $OUTPUT_DIR/testeth else - echo genhtml not found - exit; + echo genhtml not found + exit; fi else echo lcov not found exit; fi -if [ -d "$OUTPUT_DIR" ]; then - echo Cleaning previous report... - rm -r $OUTPUT_DIR -fi - -mkdir $OUTPUT_DIR -lcov --capture --directory $TESTETH --output-file $OUTPUT_DIR/full_coverage.info -lcov --extract $OUTPUT_DIR/full_coverage.info *cpp-ethereum/* --output-file $OUTPUT_DIR/testeth_coverage.info -genhtml $OUTPUT_DIR/testeth_coverage.info --output-directory $OUTPUT_DIR/testeth - echo "Coverage info should be located at: $OUTPUT_DIR/testeth" echo "Opening index..."