diff options
author | John Marino <marino@FreeBSD.org> | 2014-11-25 17:38:09 +0000 |
---|---|---|
committer | John Marino <marino@FreeBSD.org> | 2014-11-25 17:38:09 +0000 |
commit | 5e6acdaa65a92f1312d06f0bf638b877af9e7d41 (patch) | |
tree | adde80eba395cd8acdda9558ee49faa5bb69dfc3 /devel/googletest | |
parent | 1eeacf52409b45095b8942ed59ddd9b9ff3e349e (diff) | |
download | ports-5e6acdaa65a92f1312d06f0bf638b877af9e7d41.tar.gz ports-5e6acdaa65a92f1312d06f0bf638b877af9e7d41.zip |
Notes
Diffstat (limited to 'devel/googletest')
-rw-r--r-- | devel/googletest/Makefile | 23 | ||||
-rw-r--r-- | devel/googletest/distinfo | 4 | ||||
-rw-r--r-- | devel/googletest/files/patch-bsd-defines | 215 | ||||
-rw-r--r-- | devel/googletest/files/patch-include_gtest_internal_gtest-port.h | 19 | ||||
-rw-r--r-- | devel/googletest/pkg-plist | 1 |
5 files changed, 235 insertions, 27 deletions
diff --git a/devel/googletest/Makefile b/devel/googletest/Makefile index 7fc19d29dadf..9065635b78ac 100644 --- a/devel/googletest/Makefile +++ b/devel/googletest/Makefile @@ -2,27 +2,38 @@ # $FreeBSD$ PORTNAME= googletest -PORTVERSION= 1.5.0 -PORTREVISION= 1 +PORTVERSION= 1.7.0 CATEGORIES= devel MASTER_SITES= GOOGLE_CODE DISTNAME= gtest-${PORTVERSION} -MAINTAINER= clsung@FreeBSD.org +MAINTAINER= jbeich@vfemail.net COMMENT= Framework for writing C++ tests on a variety of platforms LICENSE= BSD3CLAUSE -USES= libtool python:2,build shebangfix +USES= libtool shebangfix zip GNU_CONFIGURE= yes USE_LDCONFIG= yes +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 -regression-test: - cd ${WRKSRC}; ${MAKE} check +OPTIONS_DEFINE= TEST + +TEST_USES= python:2,build +TEST_ALL_TARGET=check + +post-patch: +# enable vendor make install again (revert r562) + ${REINPLACE_CMD} -E 's/ install-(exec|data)-local//' \ + ${WRKSRC}/Makefile.in + +post-install: + ${INSTALL_SCRIPT} ${WRKSRC}/scripts/gtest-config ${STAGEDIR}${PREFIX}/bin .include <bsd.port.mk> diff --git a/devel/googletest/distinfo b/devel/googletest/distinfo index ac22d5e56030..69972091d453 100644 --- a/devel/googletest/distinfo +++ b/devel/googletest/distinfo @@ -1,2 +1,2 @@ -SHA256 (gtest-1.5.0.tar.gz) = 24156a23cfa49a194c48d1b630fd8eaa63fffc403719b5ddb94cdbe8d9a96aff -SIZE (gtest-1.5.0.tar.gz) = 896874 +SHA256 (gtest-1.7.0.zip) = 247ca18dd83f53deb1328be17e4b1be31514cedfc1e3424f672bf11fd7e0d60d +SIZE (gtest-1.7.0.zip) = 1164254 diff --git a/devel/googletest/files/patch-bsd-defines b/devel/googletest/files/patch-bsd-defines new file mode 100644 index 000000000000..ccd8f801d700 --- /dev/null +++ b/devel/googletest/files/patch-bsd-defines @@ -0,0 +1,215 @@ +Index: include/gtest/internal/gtest-port.h +=================================================================== +--- include/gtest/internal/gtest-port.h (revision 692) ++++ include/gtest/internal/gtest-port.h (working copy) +@@ -128,6 +128,10 @@ + // GTEST_OS_IOS - iOS + // GTEST_OS_IOS_SIMULATOR - iOS simulator + // GTEST_OS_NACL - Google Native Client (NaCl) ++// GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD ++// GTEST_OS_DRAGONFLY - DragonFly ++// GTEST_OS_FREEBSD - FreeBSD ++// GTEST_OS_NETBSD - NetBSD + // GTEST_OS_OPENBSD - OpenBSD + // GTEST_OS_QNX - QNX + // GTEST_OS_SOLARIS - Sun Solaris +@@ -341,6 +345,14 @@ + # define GTEST_OS_HPUX 1 + #elif defined __native_client__ + # define GTEST_OS_NACL 1 ++#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__) ++# define GTEST_OS_GNU_KFREEBSD 1 ++#elif defined __DragonFly__ ++# define GTEST_OS_DRAGONFLY 1 ++#elif defined __FreeBSD__ ++# define GTEST_OS_FREEBSD 1 ++#elif defined __NetBSD__ ++# define GTEST_OS_NETBSD 1 + #elif defined __OpenBSD__ + # define GTEST_OS_OPENBSD 1 + #elif defined __QNX__ +@@ -611,6 +623,8 @@ struct _RTL_CRITICAL_SECTION; + // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 + // to your compiler flags. + # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ ++ || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD \ ++ || GTEST_OS_NETBSD || GTEST_OS_OPENBSD \ + || GTEST_OS_QNX) + #endif // GTEST_HAS_PTHREAD + +@@ -791,7 +805,8 @@ using ::std::tuple_size; + (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \ + (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ + GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ +- GTEST_OS_OPENBSD || GTEST_OS_QNX) ++ GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || \ ++ GTEST_OS_NETBSD || GTEST_OS_OPENBSD || GTEST_OS_QNX) + # define GTEST_HAS_DEATH_TEST 1 + # include <vector> // NOLINT + #endif +@@ -824,7 +839,8 @@ using ::std::tuple_size; + (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX) + + // Determines whether test results can be streamed to a socket. +-#if GTEST_OS_LINUX ++#if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \ ++ GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD + # define GTEST_CAN_STREAM_RESULTS_ 1 + #endif + +Index: src/gtest-port.cc +=================================================================== +--- src/gtest-port.cc (revision 692) ++++ src/gtest-port.cc (working copy) +@@ -51,6 +51,14 @@ + # include <mach/vm_map.h> + #endif // GTEST_OS_MAC + ++#if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \ ++ GTEST_OS_NETBSD || GTEST_OS_OPENBSD ++# include <sys/sysctl.h> ++# if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD ++# include <sys/user.h> ++# endif ++#endif ++ + #if GTEST_OS_QNX + # include <devctl.h> + # include <fcntl.h> +@@ -104,6 +112,80 @@ size_t GetThreadCount() { + } + } + ++#elif GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \ ++ GTEST_OS_NETBSD ++ ++#if GTEST_OS_NETBSD ++#undef KERN_PROC ++#define KERN_PROC KERN_PROC2 ++#define kinfo_proc kinfo_proc2 ++#endif ++ ++#if GTEST_OS_DRAGONFLY ++#define KP_NLWP(kp) (kp.kp_nthreads) ++#elif GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD ++#define KP_NLWP(kp) (kp.ki_numthreads) ++#elif GTEST_OS_NETBSD ++#define KP_NLWP(kp) (kp.p_nlwps) ++#endif ++ ++// Returns the number of threads running in the process, or 0 to indicate that ++// we cannot detect it. ++size_t GetThreadCount() { ++ int mib[] = { ++ CTL_KERN, ++ KERN_PROC, ++ KERN_PROC_PID, ++ getpid(), ++#if GTEST_OS_NETBSD ++ sizeof(struct kinfo_proc), ++ 1, ++#endif ++ }; ++ u_int miblen = sizeof(mib) / sizeof(mib[0]); ++ struct kinfo_proc info; ++ size_t size = sizeof(info); ++ if (sysctl(mib, miblen, &info, &size, NULL, 0)) { ++ return 0; ++ } ++ return KP_NLWP(info); ++} ++#elif GTEST_OS_OPENBSD ++ ++// Returns the number of threads running in the process, or 0 to indicate that ++// we cannot detect it. ++size_t GetThreadCount() { ++ int mib[] = { ++ CTL_KERN, ++ KERN_PROC, ++ KERN_PROC_PID | KERN_PROC_SHOW_THREADS, ++ getpid(), ++ sizeof(struct kinfo_proc), ++ 0, ++ }; ++ u_int miblen = sizeof(mib) / sizeof(mib[0]); ++ ++ // get number of structs ++ size_t size; ++ if (sysctl(mib, miblen, NULL, &size, NULL, 0)) { ++ return 0; ++ } ++ mib[5] = size / mib[4]; ++ ++ // populate array of structs ++ struct kinfo_proc info[mib[5]]; ++ if (sysctl(mib, miblen, &info, &size, NULL, 0)) { ++ return 0; ++ } ++ ++ // exclude empty members ++ int nthreads = 0; ++ for (int i = 0; i < size / mib[4]; i++) { ++ if (info[i].p_tid != -1) ++ nthreads++; ++ } ++ return nthreads; ++} + #elif GTEST_OS_QNX + + // Returns the number of threads running in the process, or 0 to indicate that +Index: src/gtest.cc +=================================================================== +--- src/gtest.cc (revision 692) ++++ src/gtest.cc (working copy) +@@ -126,7 +126,7 @@ + #endif + + #if GTEST_CAN_STREAM_RESULTS_ +-# include <arpa/inet.h> // NOLINT ++# include <sys/socket.h> + # include <netdb.h> // NOLINT + #endif + +Index: test/gtest-port_test.cc +=================================================================== +--- test/gtest-port_test.cc (revision 692) ++++ test/gtest-port_test.cc (working copy) +@@ -304,7 +304,8 @@ TEST(FormatCompilerIndependentFileLocationTest, Fo + EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1)); + } + +-#if GTEST_OS_MAC || GTEST_OS_QNX ++#if GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || \ ++ GTEST_OS_GNU_KFREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD + void* ThreadFunc(void* data) { + pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data); + pthread_mutex_lock(mutex); +@@ -355,7 +356,7 @@ TEST(GetThreadCountTest, ReturnsCorrectValue) { + TEST(GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads) { + EXPECT_EQ(0U, GetThreadCount()); + } +-#endif // GTEST_OS_MAC || GTEST_OS_QNX ++#endif // GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_*BSD + + TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) { + const bool a_false_condition = false; +Index: test/gtest_unittest.cc +=================================================================== +--- test/gtest_unittest.cc (revision 692) ++++ test/gtest_unittest.cc (working copy) +@@ -117,6 +117,7 @@ TEST_F(StreamingListenerTest, OnTestIterationEnd) + EXPECT_EQ("event=TestIterationEnd&passed=1&elapsed_time=0ms\n", *output()); + } + ++#if GTEST_LANG_CXX11 // workaround breakage with GCC 4.2 + TEST_F(StreamingListenerTest, OnTestCaseStart) { + *output() = ""; + streamer_.OnTestCaseStart(TestCase("FooTest", "Bar", NULL, NULL)); +@@ -128,6 +129,7 @@ TEST_F(StreamingListenerTest, OnTestCaseEnd) { + streamer_.OnTestCaseEnd(TestCase("FooTest", "Bar", NULL, NULL)); + EXPECT_EQ("event=TestCaseEnd&passed=1&elapsed_time=0ms\n", *output()); + } ++#endif + + TEST_F(StreamingListenerTest, OnTestStart) { + *output() = ""; diff --git a/devel/googletest/files/patch-include_gtest_internal_gtest-port.h b/devel/googletest/files/patch-include_gtest_internal_gtest-port.h deleted file mode 100644 index 7f4aea7a0c34..000000000000 --- a/devel/googletest/files/patch-include_gtest_internal_gtest-port.h +++ /dev/null @@ -1,19 +0,0 @@ ---- include/gtest/internal/gtest-port.h.orig 2010-04-16 06:02:02.000000000 +0800 -+++ include/gtest/internal/gtest-port.h 2013-10-16 23:39:02.000000000 +0800 -@@ -173,6 +173,7 @@ - #include <stdlib.h> - #include <stdio.h> - #include <string.h> -+#include <unistd.h> - #ifndef _WIN32_WCE - #include <sys/stat.h> - #endif // !_WIN32_WCE -@@ -399,7 +400,7 @@ - // defining __GNUC__ and friends, but cannot compile GCC's tuple - // implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB - // Feature Pack download, which we cannot assume the user has. --#if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \ -+#if (defined(__GNUC__) && !defined(__CUDACC__) && !defined(_LIBCPP_VERSION) && (GTEST_GCC_VER_ >= 40000)) \ - || _MSC_VER >= 1600 - #define GTEST_USE_OWN_TR1_TUPLE 0 - #else diff --git a/devel/googletest/pkg-plist b/devel/googletest/pkg-plist index 8187600d2c04..5f059b780dda 100644 --- a/devel/googletest/pkg-plist +++ b/devel/googletest/pkg-plist @@ -2,6 +2,7 @@ bin/gtest-config include/gtest/gtest-death-test.h include/gtest/gtest-message.h include/gtest/gtest-param-test.h +include/gtest/gtest-printers.h include/gtest/gtest-spi.h include/gtest/gtest-test-part.h include/gtest/gtest-typed-test.h |