diff options
Diffstat (limited to 'BuildTools/Coverage/GenerateCoverageResults.sh')
-rwxr-xr-x | BuildTools/Coverage/GenerateCoverageResults.sh | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/BuildTools/Coverage/GenerateCoverageResults.sh b/BuildTools/Coverage/GenerateCoverageResults.sh index d3e6b12..f06c484 100755 --- a/BuildTools/Coverage/GenerateCoverageResults.sh +++ b/BuildTools/Coverage/GenerateCoverageResults.sh @@ -1,35 +1,25 @@ #!/bin/sh -# This script assumes that it is run from the toplevel directory, that -# the 'configure' script has been called with '--enable-coverage' - -if [ ! -f config.status ]; then - echo "Please configure your build with --enable-coverage and rebuild." - exit -1 -fi -grep -q "\-\-enable-coverage" config.status -if [ "$?" != 0 ]; then - echo "Please configure your build with --enable-coverage and rebuild." - exit -1 -fi +# This script assumes that it is run from the toplevel directory SOURCE_DIR=. -SCRIPT_DIR=Tools/Coverage +SCRIPT_DIR=BuildTools/Coverage LCOVDIR=3rdParty/LCov -RESULTS_DIR=Tools/Coverage/results +RESULTS_DIR=BuildTools/Coverage/results OUTPUT_DIR=$RESULTS_DIR/coverage-`git log --pretty=format:%ct-%h | head -n 1` -make -C $SOURCE_DIR -if [ ! -f $OUTPUT_DIR ]; then - mkdir -p $OUTPUT_DIR +if [ ! -d $OUTPUT_DIR ]; then + mkdir -p $OUTPUT_DIR fi # Reset counters $LCOVDIR/lcov --zerocounters --directory $SOURCE_DIR -# All tests -make -C $SOURCE_DIR test +# Build & run all tests +scons coverage=1 test=all + +# Run SCons $LCOVDIR/lcov --capture --directory $SOURCE_DIR -b $SOURCE_DIR --output-file $OUTPUT_DIR/all.info --test-name all cp $OUTPUT_DIR/all.info $OUTPUT_DIR/all.info.orig $SCRIPT_DIR/FilterLCovData.py $OUTPUT_DIR/all.info |