From 6827c2f3b2452e592d51ca90a807d446c27d43d0 Mon Sep 17 00:00:00 2001 From: Mike McGreevy Date: Tue, 6 May 2008 12:14:14 -0500 Subject: [svn-r14939] Purpose: Bug Fix (Bug 794) Description: Test gcov script on kagiso Solution: The bin/gcov_script was not working on kagiso (it was written to be used on heping, but since we don't have heping anymore, we need it on kagiso). There was a problem in that the generated .gcda files were being created in the /src/.libs directory when the script was expecting them to be in the /src directory. Also, -lgcov was added to LDFLAGS. The script performs configuration of HDF5 and runs the tests, and generates code coverage statistics for the source code files, which it places in the gcov_logs directory. The individual *.gcov files show the number of times each individual line of the associated source file is executed, and displays branches tken information as well. The file gcov.log shows a summary of each source file's coverage statistics in one easily accessible file. Tested: kagiso --- bin/gcov_script | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/bin/gcov_script b/bin/gcov_script index 4900efb..ac82189 100755 --- a/bin/gcov_script +++ b/bin/gcov_script @@ -17,36 +17,37 @@ # Configures, builds, and runs tests in-place; the output files will be placed # in a directory called gcov_logs. # Must be invoked from the root hdf5 directory. -# This script has only been tested on heping. +# This script has been tested on kagiso. CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs" export CFLAGS -./configure --enable-debug=all +LDFLAGS="$LDFLAGS -lgcov" +export LDFLAGS +CC=gcc +export CC +./configure make make check mkdir gcov_logs cd src -for j in *.c +for j in *.h *.c + do + ln -s ../$j .libs/$j + done +cd .libs +for j in *.gcda do gcov -b $j >> gcov.log 2>&1 done for j in *.gcov + do + mv $j ../../gcov_logs + done +mv gcov.log ../../gcov_logs +for j in *.c *.h do - mv $j ../gcov_logs + rm $j done -mv gcov.log ../gcov_logs -cd .. - - - - - - - - - - - - +cd ../.. -- cgit v0.12