Commit ed062e31 authored by pawel's avatar pawel
Browse files

A free test coverage analysis tool for C++. Analogous to purecov but quite

different in implementation. This tool does its job by instrumenting the
source as you compile. You can thus add your own instrumentation to every
line on the fly.

WWW: http://sourceforge.net/projects/covtool/

PR:		ports/174234
Submitted by:	novator24 <novator24@gmail.com>
parent a9971cab
......@@ -249,6 +249,7 @@
SUBDIR += cons
SUBDIR += cons-test
SUBDIR += cook
SUBDIR += covtool
SUBDIR += cpan-upload
SUBDIR += cpan-upload-http
SUBDIR += cppcheck
......
# Created by: novator24 <novator24@gmail.com>
# $FreeBSD$
PORTNAME= covtool
PORTVERSION= 2.1
CATEGORIES= devel
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/rel_2.0
MAINTAINER= novator24@gmail.com
COMMENT= C++ test coverage analyzer
WRKSRC= ${WRKDIR}
USE_ZIP= yes
USE_GCC= 4.6+
USE_GMAKE= yes
MAKEFILE= makefile
MAN1= cov++.1 \
covannotate.1 \
covmerge.1 \
covtool.1 \
gen_html.1
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%PORTNAME%%|${PORTNAME}|g' ${WRKSRC}/cov++
@${REINPLACE_CMD} 's|%%CXXFLAGS%%|${CXXFLAGS}|g' \
${WRKSRC}/rules.FreeBSD
post-install:
@${INSTALL_MAN} ${MAN1:S,^,${WRKSRC}/man/man1/,} \
${MANPREFIX}/man/man1/
@${INSTALL_DATA} ${WRKSRC}/cov++.cfg ${PREFIX}/etc/cov++.cfg.sample
@if [ ! -f ${PREFIX}/etc/cov++.cfg ]; then \
${CP} -p ${PREFIX}/etc/cov++.cfg.sample ${PREFIX}/etc/cov++.cfg ; \
fi
.include <bsd.port.mk>
SHA256 (covtool-2.1.zip) = fb434de196c4d86f268ee80907f2440b5870cf4e3bfa68801fe7230ee1abf9fd
SIZE (covtool-2.1.zip) = 430801
--- ./cov++.orig 2009-08-01 23:03:23.000000000 +0400
+++ ./cov++ 2012-12-06 17:44:10.000000000 +0400
@@ -18,8 +18,10 @@
#
#set -x
-TOOLDIR=`dirname $0`
-
+BINDIR=%%PREFIX%%/bin
+CFGDIR=%%PREFIX%%/etc
+OBJDIR=%%PREFIX%%/libexec/%%PORTNAME%%
+DATDIR=%%PREFIX%%/share/%%PORTNAME%%
#
# The command invocations for your compiler and linker can be
# specified in environment variables: COVTOOL_CC, COVTOOL_LN.
@@ -45,7 +47,7 @@
-o "$COVTOOL_TMP" = "" \
]
then
- . $TOOLDIR/cov++.cfg
+ . $CFGDIR/cov++.cfg
fi
mode="" # compile or link. Either -c or not -c
@@ -56,7 +58,7 @@
help()
{
- . $TOOLDIR/covtool_version
+ . $DATDIR/covtool_version
echo ""
echo "$covtool_version"
@@ -67,7 +69,7 @@
echo " cov++ [g++ options, -CBG, -VER, -KEEP, -EXT, -CMP, or -skip options] ..."
echo " Only 1 .c file can be specified. Use .c extension, not .c++"
echo " -skip options let you skip some instrumentations."
- echo " see $TOOLDIR/README"
+ echo " see $DATDIR/README"
echo " example usage:"
echo " cov++ -o progname -Da=b -I. -I.. -O2 file.c"
echo " Note: instrumentation data collection is turned off by default."
@@ -92,7 +94,7 @@
fi
keep_intermediate_file=""
-helper="$TOOLDIR/covtoolhelper.o"
+helper="$OBJDIR/covtoolhelper.o"
diag=""
while [ $# != 0 ]
@@ -144,7 +146,7 @@
"-c") mode="$option"
;;
- "-CBG") helper="$TOOLDIR/covtoolhelper_debug.o"
+ "-CBG") helper="$OBJDIR/covtoolhelper_debug.o"
;;
@@ -213,7 +215,7 @@
diag="$diag $tmpfile"
fi
- eval "$COVTOOL_CC -E $preprocessor_options $cfiles | $TOOLDIR/covtool.exe -instrument $diag $skips >$tmpfile"
+ eval "$COVTOOL_CC -E $preprocessor_options $cfiles | $BINDIR/covtool -instrument $diag $skips >$tmpfile"
eval "$COVTOOL_CC $mode $gpp_options -fpermissive $tmpfile"
errorlevel=$?
if [ "$keep_intermediate_file" = "" ] ; then rm $tmpfile ; fi
--- ./gen_html.orig 2012-12-05 19:51:17.000000000 +0400
+++ ./gen_html 2012-12-05 19:51:45.000000000 +0400
@@ -12,7 +12,7 @@
echo "can't find merged covexp database file: '$db'"
echo ""
echo "You must supply the name of a MERGED covexp file"
- echo "The covmerge.exe program adds additional information"
+ echo "The covmerge program adds additional information"
echo "needed by this script"
exit 1
fi
@@ -50,7 +50,7 @@
if [ ! -r "$3$file" ]
then
mkdir -p `dirname $3$file`
- covannotate.exe "$file" "$db" >"$3$file.txt"
+ covannotate "$file" "$db" >"$3$file.txt"
fi
link="<a href=.$file.txt>"
--- ./makefile.orig 2009-08-02 01:51:16.000000000 +0400
+++ ./makefile 2012-12-06 17:38:24.000000000 +0400
@@ -28,31 +28,14 @@
install:
- @mkdir -p $(INSTALL_DIR)
- if [ -w $(INSTALL_DIR)/. ] ; \
- then \
- for f in $(INSTALLABLES) ;\
- do \
- echo "installing $$f" ;\
- cp $$f $(INSTALL_DIR) ;\
- done ;\
- cp -r man $(INSTALL_DIR) ;\
- else \
- echo "Error: can't create $(INSTALL_DIR)" ; \
- exit 1; \
- fi
- @echo ""
- @echo ""
- @echo ""
- @echo "Installation complete"
- @echo "Add $(INSTALL_DIR) to your path"
- @echo ""
- @echo "Then run make install_tests (but not as ROOT!)"
- @echo ""
- @echo ""
- @echo "Also, add $(INSTALL_DIR) to your MANPATH."
- @echo ""
-
+ mkdir -p $(INSTALL_DIR)/bin $(INSTALL_DIR)/share/covtool $(INSTALL_DIR)/libexec/covtool
+ for f in covtool.exe covmerge.exe covannotate.exe; do \
+ mv $${f} $${f%.*} ;\
+ $(INSTALL_PROGRAM) $${f%.*} $(INSTALL_DIR)/bin ;\
+ done
+ $(INSTALL_DATA) covtoolhelper.o covtoolhelper_debug.o covtoolhelper.c $(INSTALL_DIR)/libexec/covtool
+ $(INSTALL_DATA) README COPYRIGHT covtool_version $(INSTALL_DIR)/share/covtool
+ $(INSTALL_SCRIPT) cov++ gen_html $(INSTALL_DIR)/bin
install_tests:
cd install_test ; $(MAKE) all ; $(MAKE) tests
--- ./rules.FreeBSD.orig 2012-12-06 17:33:14.000000000 +0400
+++ ./rules.FreeBSD 2012-12-06 17:33:14.000000000 +0400
@@ -0,0 +1,85 @@
+#
+# This file defines the compilation rules for building the covtool
+# programs and is used in tests in the subdirectories.
+#
+
+all::
+tests:: all
+clean::
+depend::
+
+INSTALL_DIR=$(PREFIX)
+MAKEFLAGS:=-j1
+INSTALL_PROGRAM=$(BSD_INSTALL_PROGRAM)
+INSTALL_DATA=$(BSD_INSTALL_DATA)
+INSTALL_SCRIPT=$(BSD_INSTALL_SCRIPT)
+
+#
+# select the optimization level -- optimization is the default
+# unless you change it to 1 -- or specify DEBUGGING=1 on the
+# command line
+#
+DEBUGGING=0
+ifeq ($(DEBUGGING),1)
+CCOPTS= %%CXXFLAGS%% -g -DDEBUGGING -Wall -pedantic
+else
+CCOPTS= %%CXXFLAGS%% -Wall -pedantic
+endif
+
+CCDEFS=
+CCINCS= -I. -I/usr/include/g++
+
+CCFLAGS= $(CCDEFS) \
+ $(CCOPTS) \
+ $(CCINCS)
+
+CC:=g++
+LN:=g++
+
+#
+# the following COVTOOL declarations speed up cov++ by suppressing its
+# need to read the .cfg file. You must override all 4 symbols for this
+# speed up to work.
+#
+COVTOOL_CC:= $(CC)
+COVTOOL_LN:= $(LN)
+COVTOOL_EXT:= .c
+COVTOOL_TMP:= .c++
+
+.EXPORT: COVTOOL_CC
+.EXPORT: COVTOOL_LN
+.EXPORT: COVTOOL_TMP
+.EXPORT: COVTOOL_EXT
+
+
+.SUFFIXES: .c .o .i .j .ii
+
+.c.o:
+ $(CC) -o $@ $(CCFLAGS) -fpermissive -c $<
+
+.c.i:
+ $(CC) "-D__extension__=" "-D__attribute__(X)=" -E $(CCDEFS) $(CCINCS) $< >$@
+
+
+CCDEFS:
+ echo $(CCDEFS)
+
+CCOPTS:
+ echo $(CCOPTS)
+
+CCINCS:
+ echo $(CCINCS)
+
+CCFLAGS:
+ echo $(CCFLAGS)
+
+CC:
+ echo $(CC)
+
+LN:
+ echo $(LN)
+
+
+clean::
+ rm -fr *.o *.exe *.i *.out *.diff *.a *.log *.bak *.j j.c k.c log
+ rm -fr remake.log *.covexp *.db *.ii *.c++ coverage_html
A free test coverage analysis tool for C++. Analogous to purecov but quite
different in implementation. This tool does its job by instrumenting the
source as you compile. You can thus add your own instrumentation to every
line on the fly.
WWW: http://sourceforge.net/projects/covtool/
bin/covtool
bin/covmerge
bin/covannotate
bin/cov++
bin/gen_html
@unexec if cmp -s %D/etc/cov++.cfg.sample %D/etc/cov++.cfg; then rm -f %D/etc/cov++.cfg; fi
etc/cov++.cfg.sample
@exec if [ ! -f %D/etc/cov++.cfg ] ; then cp -p %D/%F %B/cov++.cfg; fi
libexec/covtool/covtoolhelper.o
libexec/covtool/covtoolhelper_debug.o
libexec/covtool/covtoolhelper.c
%%DATADIR%%/README
%%DATADIR%%/COPYRIGHT
%%DATADIR%%/covtool_version
@dirrmtry %%DATADIR%%
@dirrmtry libexec/covtool
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment