aboutsummaryrefslogtreecommitdiffstats
path: root/devel/covtool
diff options
context:
space:
mode:
authorpawel <pawel@FreeBSD.org>2012-12-22 23:56:21 +0800
committerpawel <pawel@FreeBSD.org>2012-12-22 23:56:21 +0800
commited062e31f71085d00e18cfe84f883c00ea1b8e88 (patch)
tree6280478c5e7f7ef32c9bd11a841b1b6b6da34ef7 /devel/covtool
parenta9971caba8c1a9738c52aaf9a4d3fe6f8eaf4e82 (diff)
downloadfreebsd-ports-gnome-ed062e31f71085d00e18cfe84f883c00ea1b8e88.tar.gz
freebsd-ports-gnome-ed062e31f71085d00e18cfe84f883c00ea1b8e88.tar.zst
freebsd-ports-gnome-ed062e31f71085d00e18cfe84f883c00ea1b8e88.zip
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>
Diffstat (limited to 'devel/covtool')
-rw-r--r--devel/covtool/Makefile38
-rw-r--r--devel/covtool/distinfo2
-rw-r--r--devel/covtool/files/patch-cov++69
-rw-r--r--devel/covtool/files/patch-gen_html20
-rw-r--r--devel/covtool/files/patch-makefile42
-rw-r--r--devel/covtool/files/patch-rules.FreeBSD88
-rw-r--r--devel/covtool/pkg-descr6
-rw-r--r--devel/covtool/pkg-plist16
8 files changed, 281 insertions, 0 deletions
diff --git a/devel/covtool/Makefile b/devel/covtool/Makefile
new file mode 100644
index 000000000000..b6765c307976
--- /dev/null
+++ b/devel/covtool/Makefile
@@ -0,0 +1,38 @@
+# 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>
diff --git a/devel/covtool/distinfo b/devel/covtool/distinfo
new file mode 100644
index 000000000000..838963a1e7b3
--- /dev/null
+++ b/devel/covtool/distinfo
@@ -0,0 +1,2 @@
+SHA256 (covtool-2.1.zip) = fb434de196c4d86f268ee80907f2440b5870cf4e3bfa68801fe7230ee1abf9fd
+SIZE (covtool-2.1.zip) = 430801
diff --git a/devel/covtool/files/patch-cov++ b/devel/covtool/files/patch-cov++
new file mode 100644
index 000000000000..f84557a6e9dd
--- /dev/null
+++ b/devel/covtool/files/patch-cov++
@@ -0,0 +1,69 @@
+--- ./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
diff --git a/devel/covtool/files/patch-gen_html b/devel/covtool/files/patch-gen_html
new file mode 100644
index 000000000000..66ae30a9d989
--- /dev/null
+++ b/devel/covtool/files/patch-gen_html
@@ -0,0 +1,20 @@
+--- ./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>"
diff --git a/devel/covtool/files/patch-makefile b/devel/covtool/files/patch-makefile
new file mode 100644
index 000000000000..f20cb3ffdd91
--- /dev/null
+++ b/devel/covtool/files/patch-makefile
@@ -0,0 +1,42 @@
+--- ./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
diff --git a/devel/covtool/files/patch-rules.FreeBSD b/devel/covtool/files/patch-rules.FreeBSD
new file mode 100644
index 000000000000..130b20b74b47
--- /dev/null
+++ b/devel/covtool/files/patch-rules.FreeBSD
@@ -0,0 +1,88 @@
+--- ./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
diff --git a/devel/covtool/pkg-descr b/devel/covtool/pkg-descr
new file mode 100644
index 000000000000..4669acbf5d61
--- /dev/null
+++ b/devel/covtool/pkg-descr
@@ -0,0 +1,6 @@
+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/
diff --git a/devel/covtool/pkg-plist b/devel/covtool/pkg-plist
new file mode 100644
index 000000000000..6712351ba303
--- /dev/null
+++ b/devel/covtool/pkg-plist
@@ -0,0 +1,16 @@
+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