You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

9 years ago
#!/bin/bash
CPP_ETHEREUM_PATH=$(pwd)
9 years ago
which $CPP_ETHEREUM_PATH/build/test/testeth >/dev/null 2>&1
if [ $? != 0 ]
then
echo "You need to compile and build ethereum with cmake -DPROFILING option to the build dir!"
exit;
9 years ago
fi
9 years ago
OUTPUT_DIR="$CPP_ETHEREUM_PATH/build/test/coverage"
9 years ago
TESTETH=$CPP_ETHEREUM_PATH/build
9 years ago
9 years ago
if which lcov >/dev/null; then
9 years ago
if which genhtml >/dev/null; then
9 years ago
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
9 years ago
else
9 years ago
echo genhtml not found
exit;
9 years ago
fi
9 years ago
else
9 years ago
echo lcov not found
exit;
fi
echo "Coverage info should be located at: $OUTPUT_DIR/testeth"
9 years ago
echo "Opening index..."
9 years ago
xdg-open $OUTPUT_DIR/testeth/index.html &