aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Googletest exportHEADmasterAbseil Team2020-05-011-3/+3
| | | | | | Fix documentation. This address https://github.com/google/googletest/pull/2827. PiperOrigin-RevId: 309241571
* Googletest exportAbseil Team2020-05-011-1/+1
| | | | | | Fix link to "high-perf dependency injection technique". PiperOrigin-RevId: 308893893
* Merge pull request #2818 from inazarenko:masterGennadiy Rozental2020-05-012-17/+2
|\ | | | | | | PiperOrigin-RevId: 308711492
* | Merge pull request #2818 from inazarenko:masterGennadiy Rozental2020-05-012-2/+17
|\| | | | | | | PiperOrigin-RevId: 308650221
| * Enable protobuf printing for open-source proto messages.Igor Nazarenko2020-04-192-2/+17
| |
* | Googletest exportAbseil Team2020-05-011-2/+2
| | | | | | | | | | | | internal change PiperOrigin-RevId: 308648034
* | Merge pull request #2815 from Quuxplusone:simpleGennadiy Rozental2020-05-0113-176/+21
|\ \ | | | | | | | | | PiperOrigin-RevId: 308625388
| * | Add -Wdeprecated to the build configuration.Arthur O'Dwyer2020-04-231-4/+4
| | |
| * | Fix a -Wdeprecated warning.Arthur O'Dwyer2020-04-231-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | googletest-param-test-test.cc:502:8: error: definition of implicit copy constructor for 'NonDefaultConstructAssignString' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated] void operator=(const NonDefaultConstructAssignString&); ^
| * | Fix a -Wdeprecated warning.Arthur O'Dwyer2020-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | googletest-port-test.cc:97:11: error: definition of implicit copy constructor for 'Base' is deprecated because it has a user-declared destructor [-Werror,-Wdeprecated] virtual ~Base() {} ^
| * | Fix a -Wdeprecated warning.Arthur O'Dwyer2020-04-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | gmock-spec-builders.h:503:3: error: definition of implicit copy constructor for 'Expectation' is deprecated because it has a user-declared destructor [-Werror,-Wdeprecated] ~Expectation(); ^
| * | Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_.Arthur O'Dwyer2020-04-2311-162/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | None of these are strictly needed for correctness. A large number of them (maybe all of them?) trigger `-Wdeprecated` warnings on Clang trunk as soon as you try to use the implicitly defaulted (but deprecated) copy constructor of a class that has deleted its copy assignment operator. By declaring a deleted copy assignment operator, the old code also caused the move constructor and move assignment operator to be non-declared. This means that the old code never got move semantics -- "move-construction" would simply call the defaulted (but deprecated) copy constructor instead. With the new code, "move-construction" calls the defaulted move constructor, which I believe is what we want to happen. So this is a runtime performance optimization. Unfortunately we can't yet physically remove the definitions of these macros from gtest-port.h, because they are being used by other code internally at Google (according to zhangxy988). But no new uses should be added going forward.
| * | VariadicMatcher needs a non-defaulted move constructor for compile-time ↵Arthur O'Dwyer2020-04-161-2/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance. We are about to remove all uses of GTEST_DISALLOW_ASSIGN_ in favor of using the Rule of Zero everywhere. Unfortunately, if we use the Rule of Zero here, then when the compiler needs to figure out if VariadicMatcher is move-constructible, it will recurse down into `tuple<Args...>`, which on libstdc++ recurses too deeply. In file included from googlemock/test/gmock-matchers_test.cc:43: In file included from googlemock/include/gmock/gmock-matchers.h:258: In file included from /usr/include/c++/5.5.0/algorithm:60: In file included from /usr/include/c++/5.5.0/utility:70: In file included from /usr/include/c++/5.5.0/bits/stl_pair.h:59: In file included from /usr/include/c++/5.5.0/bits/move.h:57: /usr/bin/include/c++/5.5.0/type_traits:115:26: fatal error: recursive template instantiation exceeded maximum depth of 256 : public conditional<_B1::value, _B1, _B2>::type ^ The move constructor is the only problematic case, for some unknown reason. With GTEST_DISALLOW_ASSIGN_, the presence of a copy assignment operator causes the move constructor to be non-declared, thus non-defaulted, thus non-problematic. Without GTEST_DISALLOW_ASSIGN_, we have to do one of the following: - Default the copy constructor, so that the move constructor will be non-declared. - Define our own non-defaulted move constructor. ...except that doing the latter STILL did not work! Fortunately, the former (default the copy constructor, don't provide any move constructor) both works in practice and is semantically equivalent to the old code.
* | Googletest exportAbseil Team2020-05-016-175/+104
| | | | | | | | | | | | Rewrite ReturnNew action without using pump. PiperOrigin-RevId: 308219616
* | Googletest exportAbseil Team2020-05-011-1/+1
| | | | | | | | | | | | Use InitGoogleTest() instead of InitGoogle() in code example PiperOrigin-RevId: 308070819
* | Merge pull request #2797 from Jyun-Neng:masterGennadiy Rozental2020-05-011-15/+0
|\ \ | | | | | | | | | PiperOrigin-RevId: 307604377
| * | Remove duplicate codes existed in get-nprocessors.shJi Jyun-Neng2020-04-051-15/+0
| | |
* | | Googletest exportAbseil Team2020-05-012-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicitly define copy constructors used in googletest tests As of C++11, providing a user-declared copy assignment operator should suppress the availability of an implicit default copy constructor. Classes that provide (or delete) a copy assignment operator must provide their own copy constructor if one is desired. This may be an explicit default copy constructor if appropriate. As googletest is a C++11 codebase, this change should be made without qualification. This addresses the -Wdeprecated-copy warnings issued by trunk clang: While compiling googletest/test/googletest-death-test-test.cc: In file included from .../googletest/test/googletest-death-test-test.cc:33: .../googletest/include/gtest/gtest-death-test.h:196:8: error: definition of implicit copy constructor for 'ExitedWithCode' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy] void operator=(const ExitedWithCode& other); ^ .../googletest/test/googletest-death-test-test.cc:279:16: note: in implicit copy constructor for 'testing::ExitedWithCode' first required here EXPECT_PRED1(pred0, status0); ^ While compiling googletest/test/googletest-param-test-test.cc: .../googletest/test/googletest-param-test-test.cc:502:8: error: definition of implicit copy constructor for 'NonDefaultConstructAssignString' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy] void operator=(const NonDefaultConstructAssignString&); ^ .../googletest/test/googletest-param-test-test.cc:507:36: note: in implicit copy constructor for 'NonDefaultConstructAssignString' first required here Combine(Values(0, 1), Values(NonDefaultConstructAssignString("A"), This matches other changes made elsewhere in the googletest codebase, such as 306f3754a71d. Perhaps those previous changes did not consider test code. PiperOrigin-RevId: 307495126
* | | Googletest exportAbseil Team2020-05-011-1/+1
| | | | | | | | | | | | | | | | | | Fix comment that describes how to test against nullopt. PiperOrigin-RevId: 307448375
* | | Googletest exportAbseil Team2020-05-011-1/+1
| |/ |/| | | | | | | | | Internal change PiperOrigin-RevId: 307040308
* | Merge pull request #2805 from pepsiman:patch-1Mark Barolak2020-04-161-1/+1
|\ \ | | | | | | | | | PiperOrigin-RevId: 306462650
| * | Remove redundant .c_str()Malcolm Parsons2020-04-091-1/+1
| | |
* | | Merge pull request #2802 from e-i-n-s:fix_clang_warningMark Barolak2020-04-161-4/+4
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 306460942
| * | | gtest-unittest-api_test - fix warning in clang buildMarco Studerus2020-04-061-4/+4
| |/ /
* | | Merge pull request #2810 from ptahmose:masterMark Barolak2020-04-161-1/+1
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 306460738
| * | | fix signed/unsigned comparison issue (on OpenBSD)Juergen Bohl2020-04-121-1/+1
| |/ /
* | | Googletest exportAbseil Team2020-04-161-2/+2
| | | | | | | | | | | | | | | | | | Fix link to "After clause". Sorry, reader, but this heading is in another document! PiperOrigin-RevId: 305947971
* | | Merge pull request #2756 from Conan-Kudo:fix-pkgconfig-reqsMark Barolak2020-04-163-3/+3
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 305747437
| * | | Ensure that gtest/gmock pkgconfig requirements specify versionNeal Gompa2020-03-213-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Google Test and Google Mock require matching versions to work, so this requirement should be described in the pkgconfig files. This change is derived from the one used for the Fedora gtest package. Signed-off-by: Neal Gompa <ngompa13@gmail.com>
* | | | Merge pull request #2772 from Quuxplusone:travisMark Barolak2020-04-162-8/+5
|\ \ \ \ | | | | | | | | | | | | | | | PiperOrigin-RevId: 305747317
| * | | | Fix a typo in .travis.ymlArthur O'Dwyer2020-03-282-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code was trying to pass -Wgnu-zero-variadic-macro-arguments as part of CXXFLAGS, but it forgot the quotation marks needed around whitespace. This meant that option was ignored: https://travis-ci.org/github/google/googletest/jobs/666534177#L760 Unfortunately, the codebase is not remotely clean with respect to that warning option. It fails like this: https://travis-ci.org/github/Quuxplusone/googletest/jobs/668118135 So, remove that failing configuration from the test matrix until someone has time to look at it.
* | | | | Merge pull request #2773 from Quuxplusone:replace-noexceptMark Barolak2020-04-161-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | PiperOrigin-RevId: 305707266
| * | | | Replace the last instance of `throw()` with `noexcept`. NFC.Arthur O'Dwyer2020-03-281-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a -Wdeprecated warning. /home/travis/build/Quuxplusone/googletest/googletest/test/googletest-death-test_ex_test.cc:62:28: error: dynamic exception specifications are deprecated [-Werror,-Wdeprecated] const char* what() const throw() override { return "exceptional message"; } ^~~~~~~ /home/travis/build/Quuxplusone/googletest/googletest/test/googletest-death-test_ex_test.cc:62:28: note: use 'noexcept' instead const char* what() const throw() override { return "exceptional message"; } ^~~~~~~ noexcept
* | | | Merge pull request #2715 from kuzkry:document-premature-exit-file-protocolAndy Getz2020-04-041-0/+12
|\ \ \ \ | | | | | | | | | | | | | | | PiperOrigin-RevId: 304617903
| * | | | add documentation for the premature-exit-file protocolKrystian Kuzniarek2019-11-111-0/+12
| | | | |
* | | | | Merge pull request #2762 from pkryger:avoid_sigprofAndy Getz2020-04-041-5/+7
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | PiperOrigin-RevId: 304613137
| * | | | | Swap settimer and sigaction calls to avoid SIGPROFPrzemek Kryger2020-03-241-5/+7
| | |_|/ / | |/| | | | | | | | | | | | | Fixes #2760.
* | | | | Googletest exportAbseil Team2020-04-042-5/+7
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This change updates testing::internal::IsAProtocolMessage to return true not just for full proto messages but also for lite ones (i.e. those inheriting directly from MessageLite). PiperOrigin-RevId: 304286535
* | | | Googletest exportAbseil Team2020-03-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Do not use std::result_of as it was removed in C++20. PiperOrigin-RevId: 303783600
* | | | Merge pull request #2765 from kuzkry:unsupported-build-systemsAndy Getz2020-03-311-71/+0
|\ \ \ \ | | | | | | | | | | | | | | | PiperOrigin-RevId: 303742575
| * | | | remove chapters on Autotools, Meson and plain MakefilesKrystian Kuzniarek2020-03-241-71/+0
| |/ / /
* | | | Merge pull request #2764 from kuzkry:googletest-output-test-dead-codeAndy Getz2020-03-311-57/+0
|\ \ \ \ | |_|_|/ |/| | | | | | | PiperOrigin-RevId: 303414597
| * | | remove dead code in googletest-output-testKrystian Kuzniarek2020-03-241-57/+0
| |/ /
* | | Merge pull request #2350 from adambadura:MockFunctionFromStdFunctionXiaoyi Zhang2020-03-242-38/+143
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 302677275
| * | | Add support for std::function in MockFunction (#2277)Adam Badura2020-03-182-40/+113
| | | |
| * | | Add tests for MockFunction deduction (#2277)Adam Badura2020-03-181-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | Add tests checking that ::testing::MockFunction template argument can be deduced in a function call context. This is a property raised in the review, however, not checked before by any tests.
* | | | Googletest exportAbseil Team2020-03-2410-54/+784
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | Add --gtest_fail_fast support to googletest. - Analogous functionality to to golang -test.failfast and python --failfast - Stops test execution upon first test failure. - Also add support Bazel equivalent env var (TESTBRIDGE_TEST_RUNNER_FAIL_FAST) PiperOrigin-RevId: 302488880
* | | Googletest exportAbseil Team2020-03-201-1/+1
| | | | | | | | | | | | | | | | | | Internal change PiperOrigin-RevId: 302048013
* | | Merge pull request #2746 from Romain-Geissler-1A:mastervslashg2020-03-201-5/+18
|\ \ \ | |/ / |/| | | | | PiperOrigin-RevId: 302045808
| * | Make sure IsATTY does not clobber errno.Romain Geissler2020-03-111-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exposition of the problem: > cat main.cpp TEST(errnoTest, errnoTest) { ASSERT_EQ(errno, 0); } int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } Compiled with gcc 10 like this: > g++ -pthread -o runtest main.cpp -Wl,-Bstatic -lgtest -Wl,-Bdynamic Before patch: > ./runtest [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from errnoTest [ RUN ] errnoTest.errnoTest [ OK ] errnoTest.errnoTest (0 ms) [----------] 1 test from errnoTest (0 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (0 ms total) [ PASSED ] 1 test. (output is colored, I run this inside an interactive terminal). > ./runtest | cat [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from errnoTest [ RUN ] errnoTest.errnoTest main.cpp:5: Failure Expected equality of these values: (*__errno_location ()) Which is: 25 0 [ FAILED ] errnoTest.errnoTest (0 ms) [----------] 1 test from errnoTest (0 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (0 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] errnoTest.errnoTest 1 FAILED TEST (output is not colored, since IsTTY return false, because of the pipe, however it also clobbered errno for the tests). After the patch, both cases are working fine: > ./runtest [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from errnoTest [ RUN ] errnoTest.errnoTest [ OK ] errnoTest.errnoTest (0 ms) [----------] 1 test from errnoTest (0 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (0 ms total) [ PASSED ] 1 test. > ./runtest | cat [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from errnoTest [ RUN ] errnoTest.errnoTest [ OK ] errnoTest.errnoTest (0 ms) [----------] 1 test from errnoTest (0 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (0 ms total) [ PASSED ] 1 test.