diff options
author | deva <deva> | 2011-02-14 14:09:04 +0000 |
---|---|---|
committer | deva <deva> | 2011-02-14 14:09:04 +0000 |
commit | 04f275fea9186a75836b589022a9fa410aea7b02 (patch) | |
tree | 70d5e61af8e2e8319326d3ca8a9f3ea805fe06e8 /tools/test | |
parent | 95cfffa53760942c3ccf6abc18b81f48d03a3ff6 (diff) |
Added gcov (coverage measurement) in unittests.
Diffstat (limited to 'tools/test')
-rwxr-xr-x | tools/test | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -7,13 +7,30 @@ DEFINE=TEST_$UPPER SCRIPTDIR=`dirname $0` -COMPILE="g++ -DHAVE_CONFIG_H -I$SCRIPTDIR -g -Wall -Werror -D$DEFINE -o $OUTPUT $*" +INFILE=$1 +shift +OBJFILES="" +for f in $TEST_DEPS +do + of=`echo -n $f | cut -d'.' -f1`.o; + OBJFILES="$OBJFILES $of" +done + +COMMON_FLAGS="-DHAVE_CONFIG_H -I$SCRIPTDIR -g -D$DEFINE $TEST_LIBS $TEST_CFLAGS" +CLEAN="rm -f $OBJFILES" +PRECOMPILE="g++ -c $TEST_DEPS $COMMON_FLAGS" +COMPILE="g++ -fprofile-arcs -ftest-coverage -Wall -Werror $COMMON_FLAGS -o $OUTPUT $INFILE $OBJFILES" echo -e "\033[0;2mTesting $TEST:" echo Testing $TEST: > $OUTPUT.log echo -n "* Compiling $TEST test" echo Compiling $TEST test: > $OUTPUT.log + +echo ${CLEAN} >> $OUTPUT.log +${CLEAN} >> ${OUTPUT}.log 2>&1 +echo ${PRECOMPILE} >> $OUTPUT.log +${PRECOMPILE} >> ${OUTPUT}.log 2>&1 echo ${COMPILE} >> $OUTPUT.log if ${COMPILE} >> ${OUTPUT}.log 2>&1; then |