PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Sun Nov 11 15:01:33 PST 2007


 Makefile.am                    |    7 +++----
 src/kit/Makefile.am            |   13 +++++++++----
 src/polkit/Makefile.am         |   13 +++++++++----
 test/create-coverage-report.sh |   13 +++++++------
 4 files changed, 28 insertions(+), 18 deletions(-)

New commits:
commit 9fe5005e8ffad96562893e7b1cae79f35a7edd89
Author: David Zeuthen <davidz at redhat.com>
Date:   Sun Nov 11 17:58:00 2007 -0500

    tweak how we do coverage reporting

diff --git a/Makefile.am b/Makefile.am
index 45bbbba..492a1bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,10 +22,9 @@ $(srcdir)/ChangeLog:
 if POLKIT_GCOV_ENABLED
 .PHONY: ChangeLog $(srcdir)/ChangeLog coverage-report.txt
 coverage-report.txt :
-	make -C src/kit check-coverage
-	make -C src/polkit check-coverage
-	cat src/kit/coverage-report.txt > coverage-report.txt
-	cat src/polkit/coverage-report.txt >> coverage-report.txt
+	make -C src/kit coverage-report.txt
+	make -C src/polkit coverage-report.txt
+	$(top_srcdir)/test/create-coverage-report.sh "PolicyKit" `cat src/kit/covered-files.txt src/polkit/covered-files.txt` > coverage-report.txt
 
 check-coverage: coverage-report.txt
 	cat coverage-report.txt
diff --git a/src/kit/Makefile.am b/src/kit/Makefile.am
index a04c415..217a585 100644
--- a/src/kit/Makefile.am
+++ b/src/kit/Makefile.am
@@ -41,11 +41,16 @@ if KIT_GCOV_ENABLED
 clean-gcov:
 	rm -f *.gcov .libs/*.gcda
 
-.PHONY: coverage-report.txt
-coverage-report.txt :
-	$(top_srcdir)/test/create-coverage-report.sh kit $(filter %.c,$(libkit_la_SOURCES)) > coverage-report.txt
+.PHONY: coverage-report.txt covered-files.txt
 
-check-coverage : clean-gcov all check coverage-report.txt
+covered-files.txt :
+	echo $(addprefix src/kit/,$(filter %.c,$(libkit_la_SOURCES))) > covered-files.txt
+
+coverage-report.txt : covered-files.txt clean-gcov all check 
+	gcov $(filter %.c,$(libkit_la_SOURCES)) -o .libs/ > /dev/null
+	$(top_srcdir)/test/create-coverage-report.sh "module kit" `cat covered-files.txt` > coverage-report.txt
+
+check-coverage : coverage-report.txt
 	cat coverage-report.txt
 else
 coverage-report.txt:
diff --git a/src/polkit/Makefile.am b/src/polkit/Makefile.am
index ad53c83..54d89e4 100644
--- a/src/polkit/Makefile.am
+++ b/src/polkit/Makefile.am
@@ -85,11 +85,16 @@ if POLKIT_GCOV_ENABLED
 clean-gcov:
 	rm -f *.gcov .libs/*.gcda
 
-.PHONY: coverage-report.txt
-coverage-report.txt :
-	$(top_srcdir)/test/create-coverage-report.sh polkit $(filter %.c,$(libpolkit_la_SOURCES)) > coverage-report.txt
+.PHONY: coverage-report.txt covered-files.txt
 
-check-coverage : clean-gcov all check coverage-report.txt
+covered-files.txt :
+	echo $(addprefix src/polkit/,$(filter %.c,$(libpolkit_la_SOURCES))) > covered-files.txt
+
+coverage-report.txt : covered-files.txt clean-gcov all check
+	gcov $(filter %.c,$(libpolkit_la_SOURCES)) -o .libs/ > /dev/null
+	$(top_srcdir)/test/create-coverage-report.sh "module polkit" `cat covered-files.txt` > coverage-report.txt
+
+check-coverage : coverage-report.txt
 	cat coverage-report.txt
 else
 coverage-report.txt:
diff --git a/test/create-coverage-report.sh b/test/create-coverage-report.sh
index 336a5bd..cb14a1e 100755
--- a/test/create-coverage-report.sh
+++ b/test/create-coverage-report.sh
@@ -4,19 +4,20 @@ TOTAL_ACTUAL=0
 TOTAL_COVERED=0
 TOTAL_SOURCE=0
 
+P=$(dirname $0)/..
+
 MODULE=$1
 shift
 
+
 echo "=============================================================================="
-echo "Test coverage for module $MODULE:"
+echo "Test coverage for $MODULE:"
 echo "=============================================================================="
 
 while [ $# -gt 0 ] ; do
-    gcov $1 -o .libs/ > /dev/null
-
-    SOURCE=`cat $1 |wc -l`
-    ACTUAL=`grep -v "        -:" $1.gcov  |wc -l`
-    NOT_COVERED=`grep "    #####:" $1.gcov  |wc -l`
+    SOURCE=`cat $P/$1 |wc -l`
+    ACTUAL=`grep -v "        -:" $P/$1.gcov  |wc -l`
+    NOT_COVERED=`grep "    #####:" $P/$1.gcov  |wc -l`
     COVERED=$(($ACTUAL - $NOT_COVERED))
     PERCENT=$((100 * $COVERED / $ACTUAL))
 


More information about the hal-commit mailing list