Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2012 14:31:58 GMT
From:      Yuriy Basov <novator24@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/174234: [new port] devel/covtool: C++ Test Coverage Analyser
Message-ID:  <201212061431.qB6EVwqd028209@red.freebsd.org>
Resent-Message-ID: <201212061440.qB6Ee0Ax046663@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         174234
>Category:       ports
>Synopsis:       [new port] devel/covtool: C++ Test Coverage Analyser
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 06 14:40:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Yuriy Basov
>Release:        FreeBSD 9.0-STABLE amd64
>Organization:
Rambler
>Environment:
FreeBSD suggests03.rambler.ru 9.0-STABLE FreeBSD 9.0-STABLE #0: Wed Jan 25 17:47:33 UTC 2012     glebius@builder.rambler.ru:/usr/obj/usr/src/sys/R0  amd64
>Description:
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. Youcan thus add your own instrumentation to every line on the fly.
http://sourceforge.net/projects/covtool/
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

===> Creating shar file
===> Viewing diff with more
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	covtool
#	covtool/distinfo
#	covtool/pkg-descr
#	covtool/files
#	covtool/files/patch-rules.FreeBSD
#	covtool/files/patch-gen_html
#	covtool/files/patch-cov++
#	covtool/files/patch-makefile
#	covtool/pkg-plist
#	covtool/Makefile
#	covtool/patch.txt
#
echo c - covtool
mkdir -p covtool > /dev/null 2>&1
echo x - covtool/distinfo
sed 's/^X//' >covtool/distinfo << 'c3bc558aa0fdaeacb03c5290baffce7c'
XSHA256 (covtool-2.1.zip) = fb434de196c4d86f268ee80907f2440b5870cf4e3bfa68801fe7230ee1abf9fd
XSIZE (covtool-2.1.zip) = 430801
c3bc558aa0fdaeacb03c5290baffce7c
echo x - covtool/pkg-descr
sed 's/^X//' >covtool/pkg-descr << '0389b5f86fef878ecf086a3f0351f97c'
XA g++ test coverage analysis tool
X=================================
X
XCOVTOOL:  version 2.1, by Lowell Boggs Jr.  Use per the GNU public license (v2+)
X
XWWW:	http://sourceforge.net/projects/covtool/
0389b5f86fef878ecf086a3f0351f97c
echo c - covtool/files
mkdir -p covtool/files > /dev/null 2>&1
echo x - covtool/files/patch-rules.FreeBSD
sed 's/^X//' >covtool/files/patch-rules.FreeBSD << '9a2d8d918c4cb4470f5b71e41ec76bfe'
X--- ./rules.FreeBSD.orig	2012-12-06 17:33:14.000000000 +0400
X+++ ./rules.FreeBSD	2012-12-06 17:33:14.000000000 +0400
X@@ -0,0 +1,85 @@
X+#
X+# This file defines the compilation rules for building the covtool
X+# programs and is used in tests in the subdirectories.
X+#
X+
X+all::
X+tests:: all
X+clean::
X+depend::
X+
X+INSTALL_DIR=$(PREFIX)
X+MAKEFLAGS:=-j1
X+INSTALL_PROGRAM=$(BSD_INSTALL_PROGRAM)
X+INSTALL_DATA=$(BSD_INSTALL_DATA)
X+INSTALL_SCRIPT=$(BSD_INSTALL_SCRIPT)
X+
X+#
X+# select the optimization level -- optimization is the default
X+# unless you change it to 1 -- or specify DEBUGGING=1 on the
X+# command line
X+#
X+DEBUGGING=0
X+ifeq ($(DEBUGGING),1)
X+CCOPTS= -g -DDEBUGGING -Wall -pedantic
X+else
X+CCOPTS= -O2 -Wall -pedantic
X+endif
X+
X+CCDEFS=
X+CCINCS= -I. -I/usr/include/g++
X+
X+CCFLAGS= $(CCDEFS) \
X+	 $(CCOPTS) \
X+	 $(CCINCS)
X+
X+CC:=g++
X+LN:=g++
X+
X+#
X+# the following COVTOOL declarations speed up cov++ by suppressing its
X+# need to read the .cfg file.  You must override all 4 symbols for this
X+# speed up to work.
X+#
X+COVTOOL_CC:= $(CC)
X+COVTOOL_LN:= $(LN)
X+COVTOOL_EXT:= .c
X+COVTOOL_TMP:= .c++
X+
X+.EXPORT: COVTOOL_CC
X+.EXPORT: COVTOOL_LN
X+.EXPORT: COVTOOL_TMP
X+.EXPORT: COVTOOL_EXT
X+
X+
X+.SUFFIXES: .c .o .i .j .ii
X+
X+.c.o:
X+	$(CC) -o $@ $(CCFLAGS) -fpermissive -c $<
X+	
X+.c.i:
X+	$(CC) "-D__extension__=" "-D__attribute__(X)=" -E $(CCDEFS) $(CCINCS) $< >$@
X+
X+
X+CCDEFS:
X+	echo $(CCDEFS)
X+	
X+CCOPTS:
X+	echo $(CCOPTS)
X+	
X+CCINCS:
X+	echo $(CCINCS)
X+	
X+CCFLAGS:
X+	echo $(CCFLAGS)
X+	
X+CC:
X+	echo $(CC)
X+	
X+LN:
X+	echo $(LN)
X+	
X+	
X+clean::
X+	rm -fr *.o *.exe *.i *.out *.diff *.a *.log *.bak *.j j.c k.c log
X+	rm -fr remake.log *.covexp *.db *.ii *.c++ coverage_html
9a2d8d918c4cb4470f5b71e41ec76bfe
echo x - covtool/files/patch-gen_html
sed 's/^X//' >covtool/files/patch-gen_html << 'c5281cd00de4add8bc79df7a2be1c319'
X--- ./gen_html.orig	2012-12-05 19:51:17.000000000 +0400
X+++ ./gen_html	2012-12-05 19:51:45.000000000 +0400
X@@ -12,7 +12,7 @@
X   echo "can't find merged covexp database file: '$db'"
X   echo ""
X   echo "You must supply the name of a MERGED covexp file"
X-  echo "The covmerge.exe program adds additional information"
X+  echo "The covmerge program adds additional information"
X   echo "needed by this script"
X   exit 1
X fi
X@@ -50,7 +50,7 @@
X       if [ ! -r "$3$file" ]
X       then
X 	mkdir -p `dirname $3$file`
X-	covannotate.exe "$file" "$db" >"$3$file.txt"
X+	covannotate "$file" "$db" >"$3$file.txt"
X       fi
X 
X       link="<a href=.$file.txt>"
c5281cd00de4add8bc79df7a2be1c319
echo x - covtool/files/patch-cov++
sed 's/^X//' >covtool/files/patch-cov++ << 'af9ae7cb69dd3010805106d7b9704e29'
X--- ./cov++.orig	2009-08-01 23:03:23.000000000 +0400
X+++ ./cov++	2012-12-06 17:44:10.000000000 +0400
X@@ -18,8 +18,10 @@
X #
X #set -x
X 
X-TOOLDIR=`dirname $0`
X-
X+BINDIR=%%PREFIX%%/bin
X+CFGDIR=%%PREFIX%%/etc
X+OBJDIR=%%PREFIX%%/libexec/%%PORTNAME%%
X+DATDIR=%%PREFIX%%/share/%%PORTNAME%%
X #
X # The command invocations for your compiler and linker can be
X # specified in environment variables: COVTOOL_CC, COVTOOL_LN.
X@@ -45,7 +47,7 @@
X      -o "$COVTOOL_TMP" = "" \
X    ]
X then
X-  . $TOOLDIR/cov++.cfg
X+  . $CFGDIR/cov++.cfg
X fi
X 
X mode=""  # compile or link.  Either -c or not -c
X@@ -56,7 +58,7 @@
X 
X help()
X {
X-  . $TOOLDIR/covtool_version
X+  . $DATDIR/covtool_version
X 
X   echo ""
X   echo "$covtool_version"
X@@ -67,7 +69,7 @@
X   echo "    cov++ [g++ options, -CBG, -VER, -KEEP, -EXT, -CMP, or -skip options] ..."
X   echo "  Only 1 .c file can be specified.  Use .c extension, not .c++"
X   echo "  -skip options let you skip some instrumentations."
X-  echo "    see $TOOLDIR/README"
X+  echo "    see $DATDIR/README"
X   echo "  example usage:"
X   echo "    cov++ -o progname -Da=b -I. -I.. -O2 file.c"
X   echo "  Note:  instrumentation data collection is turned off by default."
X@@ -92,7 +94,7 @@
X fi
X 
X keep_intermediate_file=""
X-helper="$TOOLDIR/covtoolhelper.o"
X+helper="$OBJDIR/covtoolhelper.o"
X diag=""
X 
X while [ $# != 0 ]
X@@ -144,7 +146,7 @@
X     "-c") mode="$option"
X 	  ;;
X 	
X-    "-CBG") helper="$TOOLDIR/covtoolhelper_debug.o"
X+    "-CBG") helper="$OBJDIR/covtoolhelper_debug.o"
X 	    ;;
X 
X 
X@@ -213,7 +215,7 @@
X       diag="$diag $tmpfile"
X     fi
X 
X-    eval "$COVTOOL_CC -E $preprocessor_options $cfiles | $TOOLDIR/covtool.exe -instrument $diag $skips >$tmpfile"
X+    eval "$COVTOOL_CC -E $preprocessor_options $cfiles | $BINDIR/covtool -instrument $diag $skips >$tmpfile"
X     eval "$COVTOOL_CC $mode $gpp_options -fpermissive $tmpfile"
X     errorlevel=$?
X     if [ "$keep_intermediate_file" = "" ] ; then rm $tmpfile ; fi
af9ae7cb69dd3010805106d7b9704e29
echo x - covtool/files/patch-makefile
sed 's/^X//' >covtool/files/patch-makefile << 'fedeea179669c6e85fc19f51b0453d5b'
X--- ./makefile.orig	2009-08-02 01:51:16.000000000 +0400
X+++ ./makefile	2012-12-06 17:38:24.000000000 +0400
X@@ -28,31 +28,14 @@
X 	
X 
X install:
X-	@mkdir -p $(INSTALL_DIR)
X-	if [ -w $(INSTALL_DIR)/. ] ; \
X-	 then \
X-	     for f in $(INSTALLABLES) ;\
X-	     do \
X-	       echo "installing $$f" ;\
X-	       cp $$f $(INSTALL_DIR) ;\
X-	     done ;\
X-	     cp -r man $(INSTALL_DIR) ;\
X-	 else \
X-	     echo "Error:  can't create $(INSTALL_DIR)" ; \
X-	     exit 1; \
X-	 fi
X-	@echo ""
X-	@echo ""
X-	@echo ""
X-	@echo "Installation complete"
X-	@echo "Add $(INSTALL_DIR) to your path"
X-	@echo ""
X-	@echo "Then run make install_tests (but not as ROOT!)"
X-	@echo ""
X-	@echo ""
X-	@echo "Also, add $(INSTALL_DIR) to your MANPATH."
X-	@echo ""
X-	
X+	mkdir -p $(INSTALL_DIR)/bin $(INSTALL_DIR)/share/covtool $(INSTALL_DIR)/libexec/covtool
X+	for f in covtool.exe covmerge.exe covannotate.exe; do \
X+		mv $${f} $${f%.*} ;\
X+		$(INSTALL_PROGRAM) $${f%.*} $(INSTALL_DIR)/bin ;\
X+	done
X+	$(INSTALL_DATA) covtoolhelper.o covtoolhelper_debug.o covtoolhelper.c $(INSTALL_DIR)/libexec/covtool
X+	$(INSTALL_DATA) README COPYRIGHT covtool_version $(INSTALL_DIR)/share/covtool
X+	$(INSTALL_SCRIPT) cov++ gen_html $(INSTALL_DIR)/bin
X 	
X install_tests:
X 	cd install_test ; $(MAKE) all ; $(MAKE) tests
fedeea179669c6e85fc19f51b0453d5b
echo x - covtool/pkg-plist
sed 's/^X//' >covtool/pkg-plist << 'b566eff51d4e8b4bcdf8311521356bcd'
Xbin/covtool
Xbin/covmerge
Xbin/covannotate
Xbin/cov++
Xbin/gen_html
X@unexec if cmp -s %D/etc/cov++.cfg.sample %D/etc/cov++.cfg; then rm -f %D/etc/cov++.cfg; fi
Xetc/cov++.cfg.sample
X@exec if [ ! -f %D/etc/cov++.cfg ] ; then cp -p %D/%F %B/cov++.cfg; fi
Xlibexec/covtool/covtoolhelper.o
Xlibexec/covtool/covtoolhelper_debug.o
Xlibexec/covtool/covtoolhelper.c
X%%DATADIR%%/README
X%%DATADIR%%/COPYRIGHT
X%%DATADIR%%/covtool_version
X@dirrmtry %%DATADIR%%
X@dirrmtry libexec/covtool
b566eff51d4e8b4bcdf8311521356bcd
echo x - covtool/Makefile
sed 's/^X//' >covtool/Makefile << '9294907fdd76892fd8cba6fef779ed81'
X# New ports collection makefile for:	covtool
X# Date created:		2012-12-12
X# Whom:			novator24 <novator24@gmail.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	covtool
XPORTVERSION=	2.1
XCATEGORIES=	devel
XMASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/rel_2.0	
X
XMAINTAINER=	novator24@gmail.com
XCOMMENT=	C++ test coverage analyzer
X
XWRKSRC=	        ${WRKDIR}
XUSE_ZIP=	yes
XUSE_GCC=	4.6+
XUSE_GMAKE=	yes
XMAKEFILE=	makefile
X
XMAN1=		cov++.1 \
X		covannotate.1 \
X		covmerge.1 \
X		covtool.1 \
X		gen_html.1
X
Xpost-patch:
X	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
X		-e 's|%%PORTNAME%%|${PORTNAME}|g' ${WRKSRC}/cov++
X
Xpost-install:
X	@${INSTALL_MAN} ${MAN1:S,^,${WRKSRC}/man/man1/,} \
X		${MANPREFIX}/man/man1/
X	@${INSTALL_DATA} ${WRKSRC}/cov++.cfg ${PREFIX}/etc/cov++.cfg.sample
X	@if [ ! -f ${PREFIX}/etc/cov++.cfg ]; then \
X		${CP} -p ${PREFIX}/etc/cov++.cfg.sample ${PREFIX}/etc/cov++.cfg ; \
X	fi
X
X.include <bsd.port.mk>
9294907fdd76892fd8cba6fef779ed81
echo x - covtool/patch.txt
sed 's/^X//' >covtool/patch.txt << '616fb2050729110ff8d4e90a6f6e2eef'
X===> Creating shar file
616fb2050729110ff8d4e90a6f6e2eef
exit

===> Done


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212061431.qB6EVwqd028209>