[svn-commits] russell: testsuite/bamboo/trunk r635 - /bamboo/trunk/bin/build-asterisk.sh

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 29 10:29:00 CDT 2010


Author: russell
Date: Thu Jul 29 10:28:56 2010
New Revision: 635

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=635
Log:
Add coverage report generation (only for a test build plan for now)

Modified:
    bamboo/trunk/bin/build-asterisk.sh

Modified: bamboo/trunk/bin/build-asterisk.sh
URL: http://svnview.digium.com/svn/testsuite/bamboo/trunk/bin/build-asterisk.sh?view=diff&rev=635&r1=634&r2=635
==============================================================================
--- bamboo/trunk/bin/build-asterisk.sh (original)
+++ bamboo/trunk/bin/build-asterisk.sh Thu Jul 29 10:28:56 2010
@@ -77,6 +77,27 @@
 		echo "*** Found a core file after running unit tests ***"
 		gdb asterisk core* -x /usr/local/bin/bamboo/bt.txt
 	fi
+}
+
+gen_coverage_report() {
+	if ! which lcov ; then
+		echo "*** ERROR: lcov not installed.  No coverage report will be generated."
+		return
+	fi
+
+	sudo lcov --directory `pwd` --capture --output-file asterisk.info
+
+	# 
+	# Something about our build system confuses lcov such that files that are in
+	# subdirs make it into asterisk.info with a broken path.  This hack fixes it up.
+	#
+	for dir in np sip g722 ais snmp src btree db mpool recno stdtime hash ael ; do 
+		sed -ie "s/\/${dir}\/${dir}\//\/${dir}\//" asterisk.info
+	done
+
+	cd coverage
+	genhtml ../asterisk.info
+	cd ..
 }
 
 export PATH=/usr/lib/ccache:/usr/local/libexec/ccache:/usr/local/sbin:${PATH}
@@ -170,3 +191,7 @@
 	ls -l ${TEST_RESULTS_DIR}
 	cat ${TEST_RESULTS_DIR}/*.xml
 fi
+
+if [ "${PLAN}" = "AST-COVERAGETEST" ] ; then
+	gen_coverage_report
+fi




More information about the svn-commits mailing list