From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QLGIJ-0007Vr-Qw for garchives@archives.gentoo.org; Sat, 14 May 2011 14:58:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0EC661C091; Sat, 14 May 2011 14:58:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C04321C091 for ; Sat, 14 May 2011 14:58:07 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2F6A81B4034 for ; Sat, 14 May 2011 14:58:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6DA9F80505 for ; Sat, 14 May 2011 14:58:06 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: <9d1ba1a2b0911f8cb1559ad3e518d9c6fb2a0d87.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: / X-VCS-Repository: proj/libbash X-VCS-Files: .gitignore Makefile.am autogen.sh test_coverage.sh X-VCS-Directories: / X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 9d1ba1a2b0911f8cb1559ad3e518d9c6fb2a0d87 Date: Sat, 14 May 2011 14:58:06 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 9f8a5be1a47b276fdd2a15a6e1f0a1ef commit: 9d1ba1a2b0911f8cb1559ad3e518d9c6fb2a0d87 Author: Mu Qiao gentoo org> AuthorDate: Sat May 14 03:57:54 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sat May 14 14:43:48 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D9d1ba1a2 Built: support generating test coverage report A new target "test_coverage" is created to generate test coverage report in html format. To use that, you need to have lcov installed. --- .gitignore | 1 + Makefile.am | 6 ++++++ autogen.sh | 2 +- test_coverage.sh | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletions(-) diff --git a/.gitignore b/.gitignore index 60da165..db37cad 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ m4/lt~obsolete.m4 libtool ltmain.sh INSTALL +test_coverage/ diff --git a/Makefile.am b/Makefile.am index 7102884..73af619 100644 --- a/Makefile.am +++ b/Makefile.am @@ -220,6 +220,8 @@ EXTRA_DIST =3D bashast/bashast.g \ scripts/illegal_script.sh \ utils/meta_gen.sh \ scripts/foo.eclass \ + test_coverage.sh \ + autogen.sh \ $(BASH_TESTS) \ $(BASH_RESULT) \ $(EBUILD_TESTS) \ @@ -284,3 +286,7 @@ benchmark_parser: callgrind.out =20 generate_metadata: metadata_generator srcdir=3D$(srcdir) utils/meta_gen.sh + +test_coverage: dist + DIST_ARCHIVES=3D$(DIST_ARCHIVES) ./test_coverage.sh + rm $(DIST_ARCHIVES) diff --git a/autogen.sh b/autogen.sh index 3ccf6d8..d845062 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,2 +1,2 @@ #!/bin/sh -autoreconf -W all -i && ./configure --enable-gtest --enable-developer +autoreconf -W all -i && ./configure --enable-gtest --enable-developer "$= @" diff --git a/test_coverage.sh b/test_coverage.sh new file mode 100755 index 0000000..5c57d02 --- /dev/null +++ b/test_coverage.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +which lcov 1>/dev/null 2>&1 +if [ $? !=3D 0 ] +then + echo "You need to have lcov installed in order to generate the test = coverage report" + exit 1 +fi + +if [ ! $DIST_ARCHIVES ] +then + echo "You need to provide the archive name by running DIST_ARCHIVES=3D= \"ARCHIVE_NAME\" $0" + exit 1 +fi + +tar zxf $DIST_ARCHIVES +srcdir=3D${DIST_ARCHIVES/.tar.gz} +cd $srcdir + +# Reconfigure with gcov support +CXXFLAGS=3D"-g -O0 --coverage" CFLAGS=3D"-g -O0 --coverage" ./autogen.sh= --disable-shared + +# Generate gcov output +make + +# Generate html report +lcov --base-directory . --directory . --zerocounters -q +make check +lcov --base-directory . --directory . -c -o libbash_test.info +lcov --remove libbash_test.info "/usr*" -o libbash_test.info # remove ou= tput for external libraries +rm -rf ../test_coverage +genhtml -o ../test_coverage -t "libbash test coverage" --num-spaces 4 li= bbash_test.info + +# Clean work space +cd .. && rm -rf $srcdir