aboutsummaryrefslogtreecommitdiffstats
path: root/main/gtest
diff options
context:
space:
mode:
authorLuca Weiss <luca@z3ntu.xyz>2018-09-26 16:19:01 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2018-09-26 17:04:11 +0000
commitc192b978fa520ce25cc5586d3a766719d253b69f (patch)
tree23dab47f7220b32ac084ee1ce2b39405fcf543af /main/gtest
parentcb8c901d59cadc7442b9a588fda3fa9b6c8908f3 (diff)
downloadaports-c192b978fa520ce25cc5586d3a766719d253b69f.tar.bz2
aports-c192b978fa520ce25cc5586d3a766719d253b69f.tar.xz
main/gtest: Upgrade to 1.8.1 and more
Diffstat (limited to 'main/gtest')
-rw-r--r--main/gtest/APKBUILD64
-rw-r--r--main/gtest/gtest-1.8.1-libversion.patch29
-rw-r--r--main/gtest/gtest-1.8.1-null-pointer.patch17
3 files changed, 84 insertions, 26 deletions
diff --git a/main/gtest/APKBUILD b/main/gtest/APKBUILD
index ec7db8f406..f63885a709 100644
--- a/main/gtest/APKBUILD
+++ b/main/gtest/APKBUILD
@@ -1,48 +1,60 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gtest
-pkgver=1.8.0
-pkgrel=2
+pkgver=1.8.1
+pkgrel=0
pkgdesc="Google Test - C++ testing utility based on the xUnit framework (like JUnit)"
url="https://github.com/google/googletest"
arch="all"
-options="!check" # No test suite.
+options="!check" # googletest-death-test-test hangs
license="BSD-3-Clause"
-depends="libgcc bash"
-depends_dev="python3 cmake"
-makedepends="$depends_dev"
+depends=""
+makedepends="python2-dev"
install=""
-subpackages="$pkgname-dev $pkgname-doc"
-source="https://github.com/google/googletest/archive/release-$pkgver.tar.gz"
+subpackages="$pkgname-dev gmock"
+source="$pkgname-$pkgver.tar.gz::https://github.com/google/googletest/archive/release-$pkgver.tar.gz
+ gtest-1.8.1-libversion.patch
+ gtest-1.8.1-null-pointer.patch" # https://src.fedoraproject.org/rpms/gtest/tree/master
builddir="$srcdir"/googletest-release-${pkgver}
+prepare() {
+ cd "$builddir"
+ # fixup version as they are never correct
+ sed -E "s|(GOOGLETEST_VERSION) [0-9\\.]+|\\1 ${pkgver}|" -i CMakeLists.txt
+}
+
build() {
cd "$builddir"
- rm -rf build
mkdir build
cd build
- cmake -DBUILD_SHARED_LIBS=ON \
- -DCMAKE_SKIP_RPATH=ON ../
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=ON \
+ -DPYTHON_EXECUTABLE=python2 \
+ -Dgtest_build_tests=ON \
+ ..
make
}
+check() {
+ cd "$builddir"/build
+ make test
+}
+
package() {
cd "$builddir"
- for dir in usr/lib usr/include/gtest/internal/custom usr/share/licenses/gtest\
- usr/src/gtest/cmake usr/src/gtest/src; do
- install -d -m 0755 "$pkgdir"/"$dir"
- done
- install -m 0644 build/googlemock/gtest/libgtest*.so "$pkgdir"/usr/lib
-
- install -m 0644 googletest/include/gtest/*.h "$pkgdir"/usr/include/gtest
- install -m 0644 googletest/include/gtest/internal/*.h \
- "$pkgdir"/usr/include/gtest/internal/
- install -m 0644 googletest/include/gtest/internal/custom/*.h \
- "$pkgdir"/usr/include/gtest/internal/custom/
- install -m 0644 googletest/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/
- install -m 0644 googletest/CMakeLists.txt "$pkgdir"/usr/src/gtest/
- install -m 0644 googletest/cmake/* "$pkgdir"/usr/src/gtest/cmake/
+
+ DESTDIR="${pkgdir}" cmake --build build --target install
+ find "${pkgdir}" -name '*.pump' -print -delete
+}
+
+gmock() {
+ pkgdesc="Google Mock - A library for writing and using C++ mock classes"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libgmock*.so "$subpkgdir"/usr/lib/
}
-sha512sums="1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d release-1.8.0.tar.gz"
+sha512sums="e6283c667558e1fd6e49fa96e52af0e415a3c8037afe1d28b7ff1ec4c2ef8f49beb70a9327b7fc77eb4052a58c4ccad8b5260ec90e4bceeac7a46ff59c4369d7 gtest-1.8.1.tar.gz
+fd53e4a703c39cf4f1bc2eec2fac6c567e583d5e5a2ab4b52700ead77caf4f4903c4d32b8b25b983c5f650fc2b1e835fdf124b04a971705f42a707a42b34a99e gtest-1.8.1-libversion.patch
+afa75f975d8aed453c901245dae753939958d8b72e3e5c52995efe7980f44de4fd1ea08f1b0a4cc927443d858de0a1fe34a919512ce05ae443bfb9600b08f029 gtest-1.8.1-null-pointer.patch"
diff --git a/main/gtest/gtest-1.8.1-libversion.patch b/main/gtest/gtest-1.8.1-libversion.patch
new file mode 100644
index 0000000000..08904c1749
--- /dev/null
+++ b/main/gtest/gtest-1.8.1-libversion.patch
@@ -0,0 +1,29 @@
+diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
+index 8a8de1f..3d86a59 100644
+--- a/googlemock/CMakeLists.txt
++++ b/googlemock/CMakeLists.txt
+@@ -109,8 +109,10 @@ if (MSVC)
+ else()
+ cxx_library(gmock "${cxx_strict}" src/gmock-all.cc)
+ target_link_libraries(gmock PUBLIC gtest)
++ set_target_properties(gmock PROPERTIES VERSION ${GOOGLETEST_VERSION})
+ cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc)
+ target_link_libraries(gmock_main PUBLIC gmock)
++ set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
+ endif()
+ # If the CMake version supports it, attach header directory information
+ # to the targets for when we are part of a parent build (ie being pulled
+diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt
+index 9ee7940..8099130 100644
+--- a/googletest/CMakeLists.txt
++++ b/googletest/CMakeLists.txt
+@@ -131,7 +131,9 @@ endif()
+ # are used for other targets, to ensure that gtest can be compiled by a user
+ # aggressive about warnings.
+ cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
++set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION})
+ cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
++set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
+ # If the CMake version supports it, attach header directory information
+ # to the targets for when we are part of a parent build (ie being pulled
+ # in via add_subdirectory() rather than being a standalone build).
diff --git a/main/gtest/gtest-1.8.1-null-pointer.patch b/main/gtest/gtest-1.8.1-null-pointer.patch
new file mode 100644
index 0000000000..d062baca40
--- /dev/null
+++ b/main/gtest/gtest-1.8.1-null-pointer.patch
@@ -0,0 +1,17 @@
+diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
+index 96b07c6..4af3e5a 100644
+--- a/googletest/src/gtest.cc
++++ b/googletest/src/gtest.cc
+@@ -2693,10 +2693,12 @@ void TestInfo::Run() {
+ test->Run();
+ }
+
++ if (test != NULL) {
+ // Deletes the test object.
+ impl->os_stack_trace_getter()->UponLeavingGTest();
+ internal::HandleExceptionsInMethodIfSupported(
+ test, &Test::DeleteSelf_, "the test fixture's destructor");
++ }
+
+ result_.set_elapsed_time(internal::GetTimeInMillis() - start);
+