# # spec file for package googletest # # Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %if 0%{?suse_version} >= 1550 %bcond_without tests %else %bcond_with tests %endif %define _name googlemock Name: googletest Version: 1.16.0 Release: 1.2 Summary: Google C++ Testing Framework License: BSD-3-Clause Group: Development/Libraries/C and C++ URL: https://github.com/google/googletest Source0: https://github.com/google/googletest/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: googletest-rpmlintrc BuildRequires: cmake >= 3.10.0 %if 0%{?suse_version} < 1600 BuildRequires: gcc11 BuildRequires: gcc11-c++ %else BuildRequires: gcc-c++ %endif BuildRequires: pkgconfig BuildRequires: python3 BuildRequires: pkgconfig(pthread-stubs) %description Google's framework for writing C++ tests on a variety of platforms (Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, value- and type-parameterized tests, various options for running the tests, and XML test report generation. %package -n gtest Summary: Development files for the Google C++ Testing Framework Group: Development/Libraries/C and C++ Recommends: %{_name} = %{version} Obsoletes: %{name}-devel < %{version} Obsoletes: lib%{name}0 < %{version} Provides: %{name}-devel = %{version} %description -n gtest Google's framework for writing C++ tests on a variety of platforms (Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, value- and type-parameterized tests, various options for running the tests, and XML test report generation. This package provides shared libraries and header files for development with googletest. %package -n gmock Summary: Development files for the Google C++ Mocking Framework Group: Development/Libraries/C and C++ Recommends: %{name} = %{version} Provides: %{_name}-devel %description -n gmock Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s specifics in mind, Google C++ Mocking Framework (or Google Mock for short) is a library for writing and using C++ mock classes. This package provides shared libraries and header files for development with googlemock. %prep %autosetup %build %global optflags %(echo "%{optflags} -Wno-infinite-recursion -Wno-deprecated-declarations") %if 0%{?suse_version} < 1600 export CC=gcc-11 export CXX=g++-11 %else export CC=gcc-%gcc_version export CXX=g++-%gcc_version %endif %cmake \ %{?with_tests:-Dgtest_build_tests=ON} \ %{?with_tests:-Dgmock_build_tests=ON} \ %{nil} %cmake_build %install %cmake_install # Install the source code needed by some applications mkdir -p %{buildroot}%{_includedir}/gmock/src && install -m 0644 googlemock/src/* %{buildroot}%{_includedir}/gmock/src mkdir -p %{buildroot}%{_includedir}/gtest/src && install -m 0644 googletest/src/* %{buildroot}%{_includedir}/gtest/src %check %if %{with tests} %ifnarch %ix86 # googletest-port-test is checking the threadcount which is incorrect under user mode emulation %ctest %{?qemu_user_space_build:--exclude-regex googletest-port-test} %endif %endif %post -n gtest -p /sbin/ldconfig %postun -n gtest -p /sbin/ldconfig %post -n gmock -p /sbin/ldconfig %postun -n gmock -p /sbin/ldconfig %files -n gtest %license LICENSE %doc README.md %{_libdir}/libgtest.so %{_libdir}/libgtest.so.%{version} %{_libdir}/libgtest_main.so %{_libdir}/libgtest_main.so.%{version} %{_includedir}/gtest %{_libdir}/pkgconfig/gtest*.pc %files -n gmock %license LICENSE %doc README.md %{_libdir}/libgmock.so %{_libdir}/libgmock.so.%{version} %{_libdir}/libgmock_main.so %{_libdir}/libgmock_main.so.%{version} %{_includedir}/gmock %{_libdir}/cmake/GTest %{_libdir}/pkgconfig/gmock*.pc %changelog * Mon Feb 10 2025 pgajdos@suse.com - version update to 1.16.0 * C++ Language Support - GoogleTest requires at least C++14 and follows Google's Foundational C++ Support Policy - The 1.16.x branch will be the last to support C++14. Future development will require at least C++17. * Notable Changes - Bazel BUILD files now reference repositories by their canonical names from the Bazel Central Registry - Testsuite properties as are now exported as XML elements, not attributes (b4aae50). * Mon Nov 18 2024 Earl Sampson - change logic from suse_version > 1500 to suse_version < 1600 * Fri Sep 27 2024 Guang Yee - Update C++ complier version so it builds on Leap 15.6. * Tue Sep 3 2024 pgajdos@suse.com - version update to 1.15.2 * C++ Language Support * GoogleTest requires at least C++14 and follows Google's Foundational C++ Support Policy. * Bzlmod is now officially supported * Many bug fixes * Mon Jul 29 2024 Andreas Schwab - avoid extra '--' which newer ctests don't like anymore * Fri Jul 5 2024 Dirk Müller - avoid extra '--' which newer ctests don't like anymore * Tue Mar 12 2024 Takashi Iwai - Exclude test for 32bit x86 that is broken for now * Fri Mar 8 2024 Richard Rahl - update to 1.14.0: * GoogleTest requires at least C++14 * Remove the GTEST_HAS_DOWNCAST_ customization point. * Add googletest-message-test to the Bazel tests * Make testing::Message support streamed AbslStringify values * gtest: Supress warning about set unused variable * Make AbslStringify usage public in GoogleTest * Remove unused cast implementation * Use template type FloatType in the cast. * Fix C++20 compatibility bug. * Make GoogleTest handle SEH exceptions before stack unwinding rather than afterward * Resolve an issue where the resolution of operator<< overloads would attempt to instantiate the incomplete testing::internal::Secret type. * add support for nrf52 * add support for nxp qn9090 mcu * Allow clients to un-suppress output from gUnit EXPECT_EXIT tests. * Use GTEST_INTERNAL_CPLUSPLUS_LANG instead of __cplusplus * Add qualifier to avoid argument dependent lookup * Add missing std includes * Remove GTEST_FOR_GOOGLE_ macro * Remove some filesystem APIs and tests under !GTEST_HAS_FILE_SYSTEM * Sun Mar 26 2023 Andrea Manzini - update to 1.13.0: * Floating point prints full precision by default to aid in debugging * GTEST_FAIL_AT now terminates the test (like ASSERT_*), rather than failing and continuing (like EXPECT_*) * Added testing::SrcDir(), which returns the configured directory for test data files - CMake and GCC minimum according to https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md * Thu Oct 6 2022 Dirk Müller - update to 1.12.1: * Support for move-only values to Return * New matchers: WhenBase64Unescaped * ResultOf() now has a 3-arg overload that takes a description string for better error messages * CMake minimum increased to 3.5 * Fri Apr 8 2022 Martin Liška - Disable 2 warnings that are affected by GCC 12: gh#google/googletest#3792 and gh#google/googletest#3793. * Wed Feb 2 2022 Stefan Brüns - Add missing ldconfig calls in %%post/%%postun - Enable unit tests on Tumbleweed (fails on 15.x) - Update rpmlintrc for rpmlint 2.0 * Wed Jan 5 2022 Dirk Müller - update to 1.11.0: * --gtest_brief shows only test failures in output * --gtest_fail_fast stops test execution on first failure * Failures in SetUpTestSuite and TearDownTestSuite now cause tests to fail rather than log * Uninstantiated TEST_P and TYPED_TEST_P now fail unless allowlisted using GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST * new matchers and mocking behavior, see https://github.com/google/googletest/releases/tag/release-1.11.0 * Mon May 17 2021 Matej Cepl - Don't depend on python2, when we don't need it. * Sat Feb 8 2020 Luigi Baldoni - Update to version 1.10.0 * Deprecated "....TEST_CASE" API in favor of "....TEST_SUITE". In a nutshell if you have code that uses something like "INSTANTIATE_TYPED_TEST_CASE_P " - this and all other "*_TEST_CASE " are now deprecated in favor of more standard _TEST_SUITE. * New powerful MOCK_METHOD macro. For example: (Old) MOCK_METHOD1(Bar, double(std::string s)); (New) MOCK_METHOD(double, Bar, (std::string s), (override)); So there is no need to count the parameters anymore. * Sat Nov 17 2018 Jan Engelhardt - Remove errant backslahes from description. - Rewrite summaries without em dashes. * Fri Nov 16 2018 adam.majer@suse.de - Update to version 1.8.1: * add pkg-config files * add --no_stacktrace_support for json-output-unittest * allow macros inside of parametrized test names. * support JSON output format in addition to XML * add options to parallelize builds * fix double free when building Gtest/GMock in shared libraries and linking a test executable with both. * 2.6.4 is the minimum CMake version - cleanup spec file - googletest-fix-cmake-libdir-install.patch: dropped, upstreamed * Fri Dec 29 2017 tiwai@suse.de - Fix the source (and put the download URL as a comment) for matching with the actual tarball file name. * Sat Dec 16 2017 luc14n0@linuxmail.org - Update to version 1.8.0: * Update the value of GTEST_DIR to reflect the googletest dir. * Change the GTestDir marco value to reflect the new dir of googletest. * Read Bazel's $XML_OUTPUT_FILE environment variable * Restructure: - Test so each scenario is independent. - $XML_OUTPUT_FILE logic * Fixes: - Error C2440 'return' in gmock_test (gh#google/googletest#775). - Tests that return object which implement operator bool. - Operator precedence in GTEST_TEST_BOOLEAN_ with expressions that implement operator bool. - env_var_test to ignore XML_OUTPUT_FILE if already set. - Link that's returned when running tests (gh#google/googletest#714). - Rework package turning it into a source package essencially, once its original intention is to provide source files for a testing framework, a pure development package itself. Aligning with upstream ease our job and avoid unexpected bugs. - Drop libgtest0 and googletest-devel subpackages bringing gtest subpackage instead and obsoleting the previous ones, following the above change. - Provide googlemock together with googletest now that upstream officially brought this project under gloogle's wings. - Replace autoconf and automake BuildRequires by cmake and switch configure, make and make_install macros by cmake, cmake_jobs and cmake_install. Autotools are deprecated and cmake is recommended by upstream. - Drop libtool BuildRequires and autoreconf call. With the adoption of cmake it's no longer need anymore. - Drop googletest-enable-make-install.patch. No longer needed once make install is not used anymore. - Add googletest-fix-cmake-libdir-install.patch for enabling the use of /usr/lib(64) instead of /usr/local/lib(64), once upstream's CMakeLists doesn't provide flexibility in this regard. - Add googletest-rpmlintrc file to filter warnings about devel-file-in-non-devel-package, shlib-policy-missing-suffix and obsolete-not-provided as the package is a devel one itself now. * Thu Aug 20 2015 mpluskal@suse.com - Update project and source url (now on github) - Change library name, provides obsoletes should not be necessary as no released binary should link against it * Sat Feb 28 2015 mpluskal@suse.com - Correct typo in library name * Fri Feb 27 2015 mpluskal@suse.com - Use source url - Package libraries as libgoogletest0 - Run tests when building * Sun Jul 6 2014 i@marguerite.su - add patch: googletest-enable-make-install.patch * use standard procedure to install googletest. - add scripts/gtest-config to installation * used by many programs to find gtest CFLAGS and etc. - install shared libraries for sles too * Mon Nov 11 2013 i@marguerite.su - update version 1.7.0 * New feature: death tests are supported on OpenBSD and in iOS simulator now. * New feature: Google Test now implements a protocol to allow a test runner to detect that a test program has exited prematurely and report it as a failure (before it would be falsely reported as a success if the exit code is 0). * New feature: Test::RecordProperty() can now be used outside of the lifespan of a test method, in which case it will be attributed to the current test case or the test program in the XML report. * New feature (potentially breaking): --gtest_list_tests now prints the type parameters and value parameters for each test. * Improvement: char pointers and char arrays are now escaped properly in failure messages. * Improvement: failure summary in XML reports now includes file and line information. * Improvement: the XML element now has a timestamp attribute. * Improvement: When --gtest_filter is specified, XML report now doesn't contain information about tests that are filtered out. * Fixed the bug where long --gtest_filter flag values are truncated in death tests. * Potentially breaking change: RUN_ALL_TESTS() is now implemented as a function instead of a macro in order to work better with Clang. * Compatibility fixes with C++ 11 and various platforms. * Bug/warning fixes. * Sun Aug 12 2012 i@marguerite.su - rename. * Sun Aug 12 2012 i@marguerite.su - force sles build static libraries, else a lot of inner test can't build. * Sun Aug 12 2012 i@marguerite.su - further clean spec. - enable build shared libraries. * Tue Aug 9 2011 tiwai@suse.de - Add missing Group to gtest-devel - Add missing BuildRoot (for building with older distros) - Clean up spec file * Sat Jul 9 2011 ftake@geeko.jp - Initial import * Upstream version: 1.6.0