public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/libbash:master commit in: /
Date: Sat, 14 May 2011 14:58:06 +0000 (UTC)	[thread overview]
Message-ID: <9d1ba1a2b0911f8cb1559ad3e518d9c6fb2a0d87.betelgeuse@gentoo> (raw)

commit:     9d1ba1a2b0911f8cb1559ad3e518d9c6fb2a0d87
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Sat May 14 03:57:54 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sat May 14 14:43:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=9d1ba1a2

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 = 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
 
 generate_metadata: metadata_generator
 	srcdir=$(srcdir) utils/meta_gen.sh
+
+test_coverage: dist
+	DIST_ARCHIVES=$(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 [ $? != 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=\"ARCHIVE_NAME\" $0"
+    exit 1
+fi
+
+tar zxf $DIST_ARCHIVES
+srcdir=${DIST_ARCHIVES/.tar.gz}
+cd $srcdir
+
+# Reconfigure with gcov support
+CXXFLAGS="-g -O0 --coverage" CFLAGS="-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 output for external libraries
+rm -rf ../test_coverage
+genhtml -o ../test_coverage -t "libbash test coverage" --num-spaces 4 libbash_test.info
+
+# Clean work space
+cd .. && rm -rf $srcdir



             reply	other threads:[~2011-05-14 14:58 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-14 14:58 Petteri Räty [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-08-19 14:54 [gentoo-commits] proj/libbash:master commit in: / Petteri Räty
2012-06-03  9:08 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 14:24 Petteri Räty
2011-08-04 13:53 Petteri Räty
2011-07-20 14:01 Petteri Räty
2011-07-08 14:03 Petteri Räty
2011-07-08 14:03 Petteri Räty
2011-07-03 20:21 Petteri Räty
2011-06-26 13:38 Petteri Räty
2011-06-26 13:38 Petteri Räty
2011-06-25 10:30 Petteri Räty
2011-06-25 10:05 Petteri Räty
2011-06-16 16:53 Petteri Räty
2011-06-11  8:52 Petteri Räty
2011-06-11  8:52 Petteri Räty
2011-06-11  8:24 Petteri Räty
2011-06-03 14:48 Petteri Räty
2011-06-03 12:43 Petteri Räty
2011-05-27 23:03 Petteri Räty
2011-05-24 14:50 Petteri Räty
2011-05-14 14:58 Petteri Räty
2011-05-12 14:06 Petteri Räty
2011-05-11  7:19 Petteri Räty
2011-05-08 13:07 Petteri Räty
2011-05-07 12:25 Petteri Räty
2011-04-27 15:11 Petteri Räty
2011-04-20 11:26 Petteri Räty
2011-04-17 10:58 Petteri Räty
2011-04-14  4:50 Petteri Räty
2011-04-14  4:50 Petteri Räty
2011-04-12 18:29 Petteri Räty
2011-04-11  6:50 Petteri Räty
2011-04-09 13:08 Petteri Räty
2011-04-08 11:12 Petteri Räty
2011-04-07 16:44 Petteri Räty
2011-04-03 13:46 Petteri Räty
2011-04-03 13:46 Petteri Räty
2011-04-02 15:50 Petteri Räty
2011-03-30 12:48 Petteri Räty
2011-03-27  8:56 Petteri Räty
2011-03-26 19:08 Petteri Räty
2011-03-26 19:08 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-26 12:24 Petteri Räty
2011-03-25 12:11 Petteri Räty
2011-03-17  9:44 Petteri Räty
2011-03-12 11:53 Petteri Räty
2011-03-06 12:05 Petteri Räty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d1ba1a2b0911f8cb1559ad3e518d9c6fb2a0d87.betelgeuse@gentoo \
    --to=betelgeuse@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox