Browse Source

Coerage Script

cl-refactor
Dimitry 10 years ago
parent
commit
b6ca0d7856
  1. 36
      getcoverage.sh

36
getcoverage.sh

@ -2,38 +2,44 @@
CPP_ETHEREUM_PATH=$(pwd) CPP_ETHEREUM_PATH=$(pwd)
if [ ! -d "$CPP_ETHEREUM_PATH/build/test" ]; then which $CPP_ETHEREUM_PATH/build/test/testeth >/dev/null 2>&1
echo "You need to compile and build ethereum with cmake -DPROFILING option to the build dir!" if [ $? != 0 ]
exit; then
echo "You need to compile and build ethereum with cmake -DPROFILING option to the build dir!"
exit;
fi fi
OUTPUT_DIR="$CPP_ETHEREUM_PATH/build/test/coverage" OUTPUT_DIR="$CPP_ETHEREUM_PATH/build/test/coverage"
TESTETH=$CPP_ETHEREUM_PATH/build #/test/CMakeFiles/testeth.dir TESTETH=$CPP_ETHEREUM_PATH/build #/test/CMakeFiles/testeth.dir
if which lcov >/dev/null; then if which lcov >/dev/null; then
if which genhtml >/dev/null; then if which genhtml >/dev/null; then
lcov --directory $TESTETH --zerocounters lcov --directory $TESTETH --zerocounters
echo Running testeth... echo Running testeth...
$($CPP_ETHEREUM_PATH/build/test/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... echo Prepearing coverage info...
else else
echo genhtml not found echo genhtml not found
exit; exit;
fi fi
else else
echo lcov not found echo lcov not found
exit; exit;
fi
if [ -d "$OUTPUT_DIR" ]; then
echo Cleaning previous report...
rm -r $OUTPUT_DIR
fi fi
echo Cleaning previous report... mkdir $OUTPUT_DIR
rm -r $OUTPUT_DIR/testeth
rm $OUTPUT_DIR/full_coverage.info
rm $OUTPUT_DIR/testeth_coverage.info
lcov --capture --directory $TESTETH --output-file $OUTPUT_DIR/full_coverage.info 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 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 genhtml $OUTPUT_DIR/testeth_coverage.info --output-directory $OUTPUT_DIR/testeth
echo "Coverage info should be located at: $CPP_ETHEREUM_PATH/build/test/coverage/testeth" echo "Coverage info should be located at: $OUTPUT_DIR/testeth"
echo "Opening index..." echo "Opening index..."
xdg-open $CPP_ETHEREUM_PATH/build/test/coverage/testeth/index.html & xdg-open $OUTPUT_DIR/testeth/index.html &

Loading…
Cancel
Save