From d9c0e838b53f9370abeb93e4eec9f96a91b3d1d0 Mon Sep 17 00:00:00 2001 From: maroy Date: Mon, 2 Aug 2004 06:26:34 +0000 Subject: [PATCH] added global code coverage info generation --- livesupport/Makefile | 12 +-- livesupport/bin/gen_coverage_data.sh | 79 +++++++++++++++++++ .../modules/core/bin/gen_coverage_data.sh | 5 +- livesupport/modules/core/etc/Makefile.in | 4 +- .../modules/db/bin/gen_coverage_data.sh | 5 +- livesupport/modules/db/etc/Makefile.in | 4 +- .../modules/storage/bin/gen_coverage_data.sh | 5 +- livesupport/modules/storage/etc/Makefile.in | 4 +- .../scheduler/bin/gen_coverage_data.sh | 5 +- .../products/scheduler/etc/Makefile.in | 4 +- livesupport/tmp/.keepme | 1 + 11 files changed, 107 insertions(+), 21 deletions(-) create mode 100755 livesupport/bin/gen_coverage_data.sh create mode 100644 livesupport/tmp/.keepme diff --git a/livesupport/Makefile b/livesupport/Makefile index 3a46e2e48..ead6bc439 100644 --- a/livesupport/Makefile +++ b/livesupport/Makefile @@ -21,7 +21,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.5 $ +# Version : $Revision: 1.6 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/Attic/Makefile,v $ #------------------------------------------------------------------------------- @@ -40,10 +40,11 @@ FLAWFINDER = flawfinder #------------------------------------------------------------------------------- # Basic directory and file definitions #------------------------------------------------------------------------------- -BASE_DIR = . -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -ETC_DIR = ${BASE_DIR}/etc +BASE_DIR = . +DOC_DIR = ${BASE_DIR}/doc +DOXYGEN_DIR = ${DOC_DIR}/doxygen +COVERAGE_DIR = ${DOC_DIR}/coverage +ETC_DIR = ${BASE_DIR}/etc DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config @@ -113,6 +114,7 @@ flawfinder: clean: ${RMDIR} ${DOXYGEN_DIR}/html + ${RMDIR} ${COVERAGE_DIR}/* setup: tools_setup modules_setup products_setup diff --git a/livesupport/bin/gen_coverage_data.sh b/livesupport/bin/gen_coverage_data.sh new file mode 100755 index 000000000..eaaef29ba --- /dev/null +++ b/livesupport/bin/gen_coverage_data.sh @@ -0,0 +1,79 @@ +#!/bin/sh +#------------------------------------------------------------------------------- +# Copyright (c) 2004 Media Development Loan Fund +# +# This file is part of the LiveSupport project. +# http://livesupport.campware.org/ +# To report bugs, send an e-mail to bugs@campware.org +# +# LiveSupport is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LiveSupport is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LiveSupport; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# Author : $Author: maroy $ +# Version : $Revision: 1.1 $ +# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/gen_coverage_data.sh,v $ +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# This script generates code coverage data for all modules +#------------------------------------------------------------------------------- +module="LiveSupport" + +reldir=`dirname $0`/.. +basedir=`cd $reldir; pwd; cd -` +bindir=$basedir/bin +docdir=$basedir/doc +tmpdir=$basedir/tmp +modules_dir=$basedir/modules +products_dir=$basedir/products + +usrdir=`cd $basedir/usr; pwd; cd -` + +coverage_report_dir=$docdir/coverage + +core_coverage_file=$modules_dir/core/tmp/coverage.info +db_coverage_file=$modules_dir/db/tmp/coverage.info +storage_coverage_file=$modules_dir/storage/tmp/coverage.info +scheduler_coverage_file=$products_dir/scheduler/tmp/coverage.info + +coverage_file=$tmpdir/coverage.info + +lcov=$usrdir/bin/lcov +genhtml=$usrdir/bin/genhtml + + +#------------------------------------------------------------------------------- +# Execute the coverage tests one by one +#------------------------------------------------------------------------------- +$modules_dir/core/bin/gen_coverage_data.sh +$modules_dir/db/bin/gen_coverage_data.sh +$modules_dir/storage/bin/gen_coverage_data.sh +$products_dir/scheduler/bin/gen_coverage_data.sh + + +#------------------------------------------------------------------------------- +# Gather all the coverage information into one file +# remove references to the tmp directories, and replace them with the module +# directories themselves. this way the source files are found easlity by lcov +#------------------------------------------------------------------------------- +echo "" > $coverage_file +cat $core_coverage_file | sed -e "s/core\/tmp\//core\//g" >> $coverage_file +cat $db_coverage_file | sed -e "s/db\/tmp\//db\//g" >> $coverage_file +cat $storage_coverage_file | sed -e "s/storage\/tmp\//storage\//g" >> $coverage_file +cat $scheduler_coverage_file | sed -e "s/scheduler\/tmp\//scheduler\//g" >> $coverage_file + +rm -rf $coverage_report_dir +mkdir -p $coverage_report_dir +$genhtml -t "$module" -o $coverage_report_dir $coverage_file + diff --git a/livesupport/modules/core/bin/gen_coverage_data.sh b/livesupport/modules/core/bin/gen_coverage_data.sh index d3966b7bf..f406b1744 100755 --- a/livesupport/modules/core/bin/gen_coverage_data.sh +++ b/livesupport/modules/core/bin/gen_coverage_data.sh @@ -22,7 +22,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.1 $ +# Version : $Revision: 1.2 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/bin/gen_coverage_data.sh,v $ #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -47,6 +47,8 @@ lcov=$usrdir/bin/lcov genhtml=$usrdir/bin/genhtml +cd $basedir + #------------------------------------------------------------------------------- # Re-configure with covarege collection enabled, compile and run the tests #------------------------------------------------------------------------------- @@ -76,4 +78,3 @@ $genhtml -t "$module" -o $coverage_report_dir $coverage_file #------------------------------------------------------------------------------- rm -f $tmpdir/include rm -f $tmpdir/src -rm -f $raw_coverage_file $coverage_file diff --git a/livesupport/modules/core/etc/Makefile.in b/livesupport/modules/core/etc/Makefile.in index bb4f7abcd..0883b2861 100644 --- a/livesupport/modules/core/etc/Makefile.in +++ b/livesupport/modules/core/etc/Makefile.in @@ -21,7 +21,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.3 $ +# Version : $Revision: 1.4 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/etc/Makefile.in,v $ # # @configure_input@ @@ -105,7 +105,7 @@ doc: clean: ${RM} ${CORE_LIB_OBJS} ${CORE_LIB_FILE} ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da + ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info docclean: ${RMDIR} ${DOXYGEN_DIR}/html diff --git a/livesupport/modules/db/bin/gen_coverage_data.sh b/livesupport/modules/db/bin/gen_coverage_data.sh index 1758cd21e..facc6f700 100755 --- a/livesupport/modules/db/bin/gen_coverage_data.sh +++ b/livesupport/modules/db/bin/gen_coverage_data.sh @@ -22,7 +22,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.2 $ +# Version : $Revision: 1.3 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/bin/gen_coverage_data.sh,v $ #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -47,6 +47,8 @@ lcov=$usrdir/bin/lcov genhtml=$usrdir/bin/genhtml +cd $basedir + #------------------------------------------------------------------------------- # Re-configure with covarege collection enabled, compile and run the tests #------------------------------------------------------------------------------- @@ -76,4 +78,3 @@ $genhtml -t "$module" -o $coverage_report_dir $coverage_file #------------------------------------------------------------------------------- rm -f $tmpdir/include rm -f $tmpdir/src -rm -f $raw_coverage_file $coverage_file diff --git a/livesupport/modules/db/etc/Makefile.in b/livesupport/modules/db/etc/Makefile.in index d97db14f9..5fe40609d 100644 --- a/livesupport/modules/db/etc/Makefile.in +++ b/livesupport/modules/db/etc/Makefile.in @@ -21,7 +21,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.3 $ +# Version : $Revision: 1.4 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/etc/Makefile.in,v $ # # @configure_input@ @@ -117,7 +117,7 @@ doc: clean: ${RM} ${DB_LIB_OBJS} ${DB_LIB_FILE} ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da + ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info docclean: ${RMDIR} ${DOXYGEN_DIR}/html diff --git a/livesupport/modules/storage/bin/gen_coverage_data.sh b/livesupport/modules/storage/bin/gen_coverage_data.sh index e157e43b1..b326c4205 100755 --- a/livesupport/modules/storage/bin/gen_coverage_data.sh +++ b/livesupport/modules/storage/bin/gen_coverage_data.sh @@ -22,7 +22,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.1 $ +# Version : $Revision: 1.2 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/bin/gen_coverage_data.sh,v $ #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -47,6 +47,8 @@ lcov=$usrdir/bin/lcov genhtml=$usrdir/bin/genhtml +cd $basedir + #------------------------------------------------------------------------------- # Re-configure with covarege collection enabled, compile and run the tests #------------------------------------------------------------------------------- @@ -76,4 +78,3 @@ $genhtml -t "$module" -o $coverage_report_dir $coverage_file #------------------------------------------------------------------------------- rm -f $tmpdir/include rm -f $tmpdir/src -rm -f $raw_coverage_file $coverage_file diff --git a/livesupport/modules/storage/etc/Makefile.in b/livesupport/modules/storage/etc/Makefile.in index 0bb871723..14a05750a 100644 --- a/livesupport/modules/storage/etc/Makefile.in +++ b/livesupport/modules/storage/etc/Makefile.in @@ -21,7 +21,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.3 $ +# Version : $Revision: 1.4 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/etc/Makefile.in,v $ # # @configure_input@ @@ -114,7 +114,7 @@ doc: clean: ${RM} ${STORAGE_LIB_OBJS} ${STORAGE_LIB_FILE} ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da + ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info docclean: ${RMDIR} ${DOXYGEN_DIR}/html diff --git a/livesupport/products/scheduler/bin/gen_coverage_data.sh b/livesupport/products/scheduler/bin/gen_coverage_data.sh index cbf2198e8..78defef63 100755 --- a/livesupport/products/scheduler/bin/gen_coverage_data.sh +++ b/livesupport/products/scheduler/bin/gen_coverage_data.sh @@ -22,7 +22,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.1 $ +# Version : $Revision: 1.2 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/bin/gen_coverage_data.sh,v $ #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -47,6 +47,8 @@ lcov=$usrdir/bin/lcov genhtml=$usrdir/bin/genhtml +cd $basedir + #------------------------------------------------------------------------------- # Re-configure with covarege collection enabled, compile and run the tests #------------------------------------------------------------------------------- @@ -76,4 +78,3 @@ $genhtml -t "$module" -o $coverage_report_dir $coverage_file #------------------------------------------------------------------------------- rm -f $tmpdir/include rm -f $tmpdir/src -rm -f $raw_coverage_file $coverage_file diff --git a/livesupport/products/scheduler/etc/Makefile.in b/livesupport/products/scheduler/etc/Makefile.in index f53cbd3dd..1760ee4f4 100644 --- a/livesupport/products/scheduler/etc/Makefile.in +++ b/livesupport/products/scheduler/etc/Makefile.in @@ -21,7 +21,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.7 $ +# Version : $Revision: 1.8 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/etc/Makefile.in,v $ # # @configure_input@ @@ -158,7 +158,7 @@ doc: clean: ${RM} ${SCHEDULER_EXE_OBJS} ${SCHEDULER_EXE} ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da + ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info docclean: ${RMDIR} ${DOXYGEN_DIR}/html diff --git a/livesupport/tmp/.keepme b/livesupport/tmp/.keepme new file mode 100644 index 000000000..e0808fa16 --- /dev/null +++ b/livesupport/tmp/.keepme @@ -0,0 +1 @@ +keep me