Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Oct 2015 01:31:59 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r398458 - in head/devel: googlemock googlemock/files googletest
Message-ID:  <201510030131.t931VxP6010392@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sat Oct  3 01:31:58 2015
New Revision: 398458
URL: https://svnweb.freebsd.org/changeset/ports/398458

Log:
  devel/google{test,mock}: simplify and modernize
  
  - Convert to the new testing framework
  - Add upstream fix for gmock_doctor.py to work with python3, so
    keep existing |/usr/bin/env python| shebang
  - Drop fused-src tests as the ports don't install source files
  - No need to shebangfix files we don't install
  - Provide LICENSE_FILE as there's none under Templates/Licenses/
  - Sort declarations by the order they're run (ldconfig is last)
  - Silence post-patch commands [1]
  
  PR:		203514
  Submitted by:	amdmi3 [1]
  Reviewed by:	amdmi3 (previous version)

Added:
  head/devel/googlemock/files/
  head/devel/googlemock/files/patch-scripts_gmock__doctor.py   (contents, props changed)
Modified:
  head/devel/googlemock/Makefile   (contents, props changed)
  head/devel/googletest/Makefile   (contents, props changed)

Modified: head/devel/googlemock/Makefile
==============================================================================
--- head/devel/googlemock/Makefile	Sat Oct  3 00:59:57 2015	(r398457)
+++ head/devel/googlemock/Makefile	Sat Oct  3 01:31:58 2015	(r398458)
@@ -4,12 +4,14 @@
 PORTNAME=	googlemock
 PORTVERSION=	1.7.0
 DISTVERSIONPREFIX=	release-
+PORTREVISION=	1
 CATEGORIES=	devel
 
 MAINTAINER=	jbeich@FreeBSD.org
 COMMENT=	Library for writing and using C++ mock classes
 
 LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	${LOCALBASE}/share/aclocal/ax_pthread.m4:${PORTSDIR}/devel/autoconf-archive \
 		googletest>=1.7.0:${PORTSDIR}/devel/googletest
@@ -18,25 +20,19 @@ LIB_DEPENDS=	libgtest.so:${PORTSDIR}/dev
 USE_GITHUB=	yes
 GH_ACCOUNT=	google
 
-USES=		autoreconf libtool shebangfix
+USES=		autoreconf libtool
 GNU_CONFIGURE=	yes
-USE_LDCONFIG=	yes
+# fused-src python tests are only useful for bundling. There's no point in
+# running them before installing system-wide without source files.
+CONFIGURE_ENV=	ac_cv_path_PYTHON=":"
+TEST_TARGET=	check
 INSTALL_TARGET=	install-strip
-
-CONFIGURE_ENV=	ac_cv_path_PYTHON=python2
-python_OLD_CMD=	/usr/bin/env python
-python_CMD=	/usr/bin/env python2
-SHEBANG_FILES=	scripts/fuse_gmock_files.py scripts/gmock_doctor.py
-
-OPTIONS_DEFINE=	TEST
-
-TEST_USES=	python:2,build
-TEST_ALL_TARGET=check
+USE_LDCONFIG=	yes
 
 post-patch:
-	${REINPLACE_CMD} '/acx_pthread.m4/d' ${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} '/acx_pthread.m4/d' ${WRKSRC}/configure.ac
 # enable vendor make install again (revert 52277c9)
-	${REINPLACE_CMD} -E 's/install-(exec|data)-local/&-dummy/' \
+	@${REINPLACE_CMD} -E 's/install-(exec|data)-local/&-dummy/' \
 		${WRKSRC}/Makefile.am
 
 post-install:

Added: head/devel/googlemock/files/patch-scripts_gmock__doctor.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/googlemock/files/patch-scripts_gmock__doctor.py	Sat Oct  3 01:31:58 2015	(r398458)
@@ -0,0 +1,41 @@
+From ac830d6b197f8b8dad24782d7900c69cee0ab77e Mon Sep 17 00:00:00 2001
+From: Syl <srouquette@gmail.com>
+Date: Sun, 30 Aug 2015 08:57:48 +0200
+Subject: [PATCH] Fix gmock_doctor.py for Python3
+
+--- scripts/gmock_doctor.py.orig	2013-09-19 00:32:04 UTC
++++ scripts/gmock_doctor.py
+@@ -590,7 +590,7 @@ def main():
+     print ('Please copy and paste the compiler errors here.  Press c-D when '
+            'you are done:')
+   else:
+-    print 'Waiting for compiler errors on stdin . . .'
++    print ('Waiting for compiler errors on stdin . . .')
+ 
+   msg = sys.stdin.read().strip()
+   diagnoses = Diagnose(msg)
+@@ -608,18 +608,18 @@ If you send your source code and the com
+ %s, you can be helped and I can get smarter --
+ win-win for us!""" % (msg, _EMAIL))
+   else:
+-    print '------------------------------------------------------------'
+-    print 'Your code appears to have the following',
++    print ('------------------------------------------------------------')
++    print ('Your code appears to have the following',)
+     if count > 1:
+-      print '%s diseases:' % (count,)
++      print ('%s diseases:' % (count,))
+     else:
+-      print 'disease:'
++      print ('disease:')
+     i = 0
+     for d in diagnoses:
+       i += 1
+       if count > 1:
+-        print '\n#%s:' % (i,)
+-      print d
++        print ('\n#%s:' % (i,))
++      print (d)
+     print ("""
+ How did I do?  If you think I'm wrong or unhelpful, please send your
+ source code and the compiler's error messages to %s.

Modified: head/devel/googletest/Makefile
==============================================================================
--- head/devel/googletest/Makefile	Sat Oct  3 00:59:57 2015	(r398457)
+++ head/devel/googletest/Makefile	Sat Oct  3 01:31:58 2015	(r398458)
@@ -10,29 +10,23 @@ MAINTAINER=	jbeich@FreeBSD.org
 COMMENT=	Framework for writing C++ tests on a variety of platforms
 
 LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	google
 
-USES=		autoreconf libtool shebangfix
+USES=		autoreconf libtool
 GNU_CONFIGURE=	yes
-USE_LDCONFIG=	yes
+# fused-src python tests are only useful for bundling. There's no point in
+# running them before installing system-wide without source files.
+CONFIGURE_ENV=	ac_cv_path_PYTHON=":"
+TEST_TARGET=	check
 INSTALL_TARGET=	install-strip
-
-CONFIGURE_ENV=	ac_cv_path_PYTHON=python2
-python_OLD_CMD=	/usr/bin/env python
-python_CMD=	/usr/bin/env python2
-SHEBANG_FILES=	scripts/fuse_gtest_files.py scripts/gen_gtest_pred_impl.py \
-		scripts/pump.py
-
-OPTIONS_DEFINE=	TEST
-
-TEST_USES=	python:2,build
-TEST_ALL_TARGET=check
+USE_LDCONFIG=	yes
 
 post-patch:
 # enable vendor make install again (revert 661758e)
-	${REINPLACE_CMD} -E 's/install-(exec|data)-local/&-dummy/' \
+	@${REINPLACE_CMD} -E 's/install-(exec|data)-local/&-dummy/' \
 		${WRKSRC}/Makefile.am
 
 post-install:



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