Update to 1.8.0
Merge gtest and gmock Thanks to Dan Cermak for help!
This commit is contained in:
parent
b1debdf89b
commit
4a532e165b
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ gtest-1.4.0.tar.bz2
|
||||
/gtest-1.5.0.tar.bz2
|
||||
/gtest-1.6.0.zip
|
||||
/gtest-1.7.0.zip
|
||||
/release-1.8.0.tar.gz
|
||||
|
||||
24
gtest-1.8.0-libdir.patch
Normal file
24
gtest-1.8.0-libdir.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff -up googletest-release-1.8.0/googlemock/CMakeLists.txt.libdir googletest-release-1.8.0/googlemock/CMakeLists.txt
|
||||
--- googletest-release-1.8.0/googlemock/CMakeLists.txt.libdir 2016-08-31 16:20:48.805836249 -0600
|
||||
+++ googletest-release-1.8.0/googlemock/CMakeLists.txt 2016-08-31 16:19:24.596216228 -0600
|
||||
@@ -104,7 +104,7 @@ endif()
|
||||
#
|
||||
# Install rules
|
||||
install(TARGETS gmock gmock_main
|
||||
- DESTINATION lib)
|
||||
+ DESTINATION lib${LIB_SUFFIX})
|
||||
install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
|
||||
DESTINATION include)
|
||||
|
||||
diff -up googletest-release-1.8.0/googletest/CMakeLists.txt.libdir googletest-release-1.8.0/googletest/CMakeLists.txt
|
||||
--- googletest-release-1.8.0/googletest/CMakeLists.txt.libdir 2016-07-14 11:15:38.000000000 -0600
|
||||
+++ googletest-release-1.8.0/googletest/CMakeLists.txt 2016-08-31 16:20:19.357969126 -0600
|
||||
@@ -103,7 +103,7 @@ endif()
|
||||
#
|
||||
# Install rules
|
||||
install(TARGETS gtest gtest_main
|
||||
- DESTINATION lib)
|
||||
+ DESTINATION lib${LIB_SUFFIX})
|
||||
install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
|
||||
DESTINATION include)
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
--- gtest-1.6.0.orig/CMakeLists.txt 2011-04-16 04:49:11.000000000 +0900
|
||||
+++ gtest-1.6.0/CMakeLists.txt 2012-09-28 14:20:19.000000000 +0900
|
||||
@@ -68,7 +68,9 @@ link_directories(${gtest_BINARY_DIR}/src
|
||||
# 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 0.0.0 SOVERSION 0)
|
||||
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
|
||||
+set_target_properties(gtest_main PROPERTIES VERSION 0.0.0 SOVERSION 0)
|
||||
target_link_libraries(gtest_main gtest)
|
||||
|
||||
########################################################################
|
||||
123
gtest.spec
123
gtest.spec
@ -1,18 +1,16 @@
|
||||
Summary: Google C++ testing framework
|
||||
Name: gtest
|
||||
Version: 1.7.0
|
||||
Release: 11%{?dist}
|
||||
Version: 1.8.0
|
||||
Release: 1%{?dist}
|
||||
License: BSD
|
||||
Group: Development/Tools
|
||||
URL: http://code.google.com/p/googletest/
|
||||
Source0: http://googletest.googlecode.com/files/gtest-%{version}.zip
|
||||
Patch0: gtest-soname.patch
|
||||
URL: https://github.com/google/googletest
|
||||
Source0: https://github.com/google/googletest/archive/release-%{version}.tar.gz
|
||||
# Install into lib64 if needed
|
||||
Patch0: gtest-1.8.0-libdir.patch
|
||||
# https://github.com/google/googletest/issues/845
|
||||
Patch1: gtest-null-pointer.patch
|
||||
Patch1: gtest-1.8.0-null-pointer.patch
|
||||
BuildRequires: cmake
|
||||
BuildRequires: libtool
|
||||
BuildRequires: python-devel
|
||||
|
||||
%description
|
||||
Framework for writing C++ tests on a variety of platforms (GNU/Linux,
|
||||
Mac OS X, Windows, Windows CE, and Symbian). Based on the xUnit
|
||||
@ -21,78 +19,87 @@ assertions, user-defined assertions, death tests, fatal and non-fatal
|
||||
failures, various options for running the tests, and XML test report
|
||||
generation.
|
||||
|
||||
%package devel
|
||||
%package -n gtest-devel
|
||||
Summary: Development files for %{name}
|
||||
Group: Development/Libraries
|
||||
Requires: automake
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
%description -n gtest-devel
|
||||
This package contains development files for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .0-soname
|
||||
%patch1 -p2 -b .0-null-pointer
|
||||
%package -n gmock
|
||||
Summary: Google C++ Mocking Framework
|
||||
|
||||
# keep a clean copy of samples.
|
||||
cp -a ./samples ./samples.orig
|
||||
%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.
|
||||
|
||||
Google Mock:
|
||||
|
||||
o lets you create mock classes trivially using simple macros,
|
||||
o supports a rich set of matchers and actions,
|
||||
o handles unordered, partially ordered, or completely ordered
|
||||
expectations,
|
||||
o is extensible by users, and
|
||||
o works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
|
||||
Symbian.
|
||||
|
||||
%package -n gmock-devel
|
||||
Summary: Development files for gmock
|
||||
Group: System Environment/Libraries
|
||||
Requires: gmock = %{version}-%{release}
|
||||
|
||||
%description -n gmock-devel
|
||||
This package contains development files for gmock.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n googletest-release-%{version}
|
||||
|
||||
%build
|
||||
# this is odd but needed only to generate gtest-config.
|
||||
%configure
|
||||
mkdir build && pushd build
|
||||
mkdir build && cd build
|
||||
%cmake -DBUILD_SHARED_LIBS=ON \
|
||||
-DCMAKE_SKIP_BUILD_RPATH=TRUE \
|
||||
-DPYTHON_EXECUTABLE=%{__python2} \
|
||||
-Dgtest_build_tests=ON ..
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%check
|
||||
# LD_LIBRARY_PATH needed due to cmake_skip_rpath in %%build
|
||||
pushd build
|
||||
LD_LIBRARY_PATH=$RPM_BUILD_DIR/%{name}-%{version}/build make test
|
||||
popd
|
||||
|
||||
# Restore the clean copy of samples.
|
||||
# To be later listed against doc.
|
||||
rm -rf ./samples
|
||||
mv ./samples.orig ./samples
|
||||
|
||||
%install
|
||||
# make install doesn't work anymore.
|
||||
# need to install them manually.
|
||||
install -d %{buildroot}{%{_includedir}/gtest{,/internal},%{_libdir}}
|
||||
# just for backward compatibility
|
||||
install -p -m 0755 build/libgtest.so.*.* build/libgtest_main.so.*.* %{buildroot}%{_libdir}/
|
||||
(cd %{buildroot}%{_libdir};
|
||||
ln -sf libgtest.so.*.* %{buildroot}%{_libdir}/libgtest.so
|
||||
ln -sf libgtest_main.so.*.* %{buildroot}%{_libdir}/libgtest_main.so
|
||||
)
|
||||
/sbin/ldconfig -n %{buildroot}%{_libdir}
|
||||
install -D -p -m 0755 scripts/gtest-config %{buildroot}%{_bindir}/gtest-config
|
||||
install -p -m 0644 include/gtest/*.h %{buildroot}%{_includedir}/gtest/
|
||||
install -p -m 0644 include/gtest/internal/*.h %{buildroot}%{_includedir}/gtest/internal/
|
||||
install -D -p -m 0644 m4/gtest.m4 %{buildroot}%{_datadir}/aclocal/gtest.m4
|
||||
cd build
|
||||
%make_install
|
||||
|
||||
%check
|
||||
cd build
|
||||
make test
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%doc CHANGES CONTRIBUTORS LICENSE README
|
||||
%{_libdir}/libgtest.so.*
|
||||
%{_libdir}/libgtest_main.so.*
|
||||
|
||||
%files devel
|
||||
%doc samples
|
||||
%{_bindir}/gtest-config
|
||||
%{_datadir}/aclocal/gtest.m4
|
||||
%license googletest/LICENSE
|
||||
%doc googletest/{CHANGES,CONTRIBUTORS,README.md}
|
||||
%doc googletest/docs/
|
||||
%{_libdir}/libgtest.so
|
||||
%{_libdir}/libgtest_main.so
|
||||
%{_includedir}/gtest
|
||||
|
||||
%files -n gtest-devel
|
||||
%doc googletest/samples
|
||||
%{_includedir}/gtest/
|
||||
|
||||
%files -n gmock
|
||||
%license googlemock/LICENSE
|
||||
%doc googlemock/{CHANGES,CONTRIBUTORS,README.md}
|
||||
%doc googlemock/docs/
|
||||
%{_libdir}/libgmock.so
|
||||
%{_libdir}/libgmock_main.so
|
||||
|
||||
%files -n gmock-devel
|
||||
%{_includedir}/gmock/
|
||||
|
||||
%changelog
|
||||
* Sun Oct 15 2017 Dan Cermak <dan.cermak@cgc-instruments.com> - 1.8.0-1
|
||||
- 1.8.0
|
||||
- Merge gtest and gmock (rhbz#1314927)
|
||||
|
||||
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
@ -140,7 +147,7 @@ install -D -p -m 0644 m4/gtest.m4 %{buildroot}%{_datadir}/aclocal/gtest.m4
|
||||
|
||||
* Fri Sep 28 2012 Akira TAGOH <tagoh@redhat.com> - 1.6.0-1
|
||||
- New upstream release.
|
||||
- Using autotools isn't supported in upstream anymore. switching to cmake.
|
||||
- Using autotools is not supported in upstream anymore. switching to cmake.
|
||||
- undefined reference issues seems gone now. (#813825)
|
||||
|
||||
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-7
|
||||
|
||||
Loading…
Reference in New Issue
Block a user