summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-01 08:48:42 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-01 09:24:28 (GMT)
commit2812bddd81f8a1b804c7460f4e14cd0aa393d129 (patch)
treed46294f35150c4f0f43deaf2d31fceaf945ae715 /tools/coverage/GenerateCoverageResults.sh
downloadswift-contrib-2812bddd81f8a1b804c7460f4e14cd0aa393d129.zip
swift-contrib-2812bddd81f8a1b804c7460f4e14cd0aa393d129.tar.bz2
Import.
Diffstat (limited to 'tools/coverage/GenerateCoverageResults.sh')
-rwxr-xr-xtools/coverage/GenerateCoverageResults.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/coverage/GenerateCoverageResults.sh b/tools/coverage/GenerateCoverageResults.sh
new file mode 100755
index 0000000..9e32da4
--- /dev/null
+++ b/tools/coverage/GenerateCoverageResults.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script assumes that it is run from the toplevel directory, that
+# the 'configure' script has been called with '--enable-coverage'
+
+SOURCE_DIR=src/Swift
+SCRIPT_DIR=tools/coverage
+
+RESULTS_DIR=tools/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
+fi
+
+# Reset counters
+lcov --zerocounters --directory $SOURCE_DIR
+
+# All tests
+make -C $SOURCE_DIR test
+lcov --capture --directory $SOURCE_DIR -b $SOURCE_DIR --output-file $OUTPUT_DIR/all.info --test-name all
+$SCRIPT_DIR/FilterLCovData.py $OUTPUT_DIR/all.info
+
+# Generate HTML
+gendesc -o $OUTPUT_DIR/descriptions $SCRIPT_DIR/descriptions.txt
+genhtml --title "Swift Coverage" --output-directory $OUTPUT_DIR $OUTPUT_DIR/all.info
+
+# Generate summary
+$SCRIPT_DIR/GenerateSummary.py $OUTPUT_DIR/all.info $OUTPUT_DIR/summary