Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2012 15:56:21 +0000 (UTC)
From:      Pawel Pekala <pawel@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r309395 - in head/devel: . covtool covtool/files
Message-ID:  <201212221556.qBMFuL7P006641@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pawel
Date: Sat Dec 22 15:56:21 2012
New Revision: 309395
URL: http://svnweb.freebsd.org/changeset/ports/309395

Log:
  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>

Added:
  head/devel/covtool/
  head/devel/covtool/Makefile   (contents, props changed)
  head/devel/covtool/distinfo   (contents, props changed)
  head/devel/covtool/files/
  head/devel/covtool/files/patch-cov++   (contents, props changed)
  head/devel/covtool/files/patch-gen_html   (contents, props changed)
  head/devel/covtool/files/patch-makefile   (contents, props changed)
  head/devel/covtool/files/patch-rules.FreeBSD   (contents, props changed)
  head/devel/covtool/pkg-descr   (contents, props changed)
  head/devel/covtool/pkg-plist   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Sat Dec 22 15:01:26 2012	(r309394)
+++ head/devel/Makefile	Sat Dec 22 15:56:21 2012	(r309395)
@@ -249,6 +249,7 @@
     SUBDIR += cons
     SUBDIR += cons-test
     SUBDIR += cook
+    SUBDIR += covtool
     SUBDIR += cpan-upload
     SUBDIR += cpan-upload-http
     SUBDIR += cppcheck

Added: head/devel/covtool/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/Makefile	Sat Dec 22 15:56:21 2012	(r309395)
@@ -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>

Added: head/devel/covtool/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/distinfo	Sat Dec 22 15:56:21 2012	(r309395)
@@ -0,0 +1,2 @@
+SHA256 (covtool-2.1.zip) = fb434de196c4d86f268ee80907f2440b5870cf4e3bfa68801fe7230ee1abf9fd
+SIZE (covtool-2.1.zip) = 430801

Added: head/devel/covtool/files/patch-cov++
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/files/patch-cov++	Sat Dec 22 15:56:21 2012	(r309395)
@@ -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

Added: head/devel/covtool/files/patch-gen_html
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/files/patch-gen_html	Sat Dec 22 15:56:21 2012	(r309395)
@@ -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>"

Added: head/devel/covtool/files/patch-makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/files/patch-makefile	Sat Dec 22 15:56:21 2012	(r309395)
@@ -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

Added: head/devel/covtool/files/patch-rules.FreeBSD
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/files/patch-rules.FreeBSD	Sat Dec 22 15:56:21 2012	(r309395)
@@ -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

Added: head/devel/covtool/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/pkg-descr	Sat Dec 22 15:56:21 2012	(r309395)
@@ -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/

Added: head/devel/covtool/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/covtool/pkg-plist	Sat Dec 22 15:56:21 2012	(r309395)
@@ -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



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