summaryrefslogtreecommitdiffstats
path: root/googletest
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3866 from eidosmontreal:simplify_shouldusecolorCopybara-Service2022-06-132-6/+2
|\ | | | | | | | | PiperOrigin-RevId: 454616721 Change-Id: I33b5671646ec027da48cc941baf84b4ddc722e07
| * Simplify ColoredPrintf to rely on ShouldUseColorGaspard Petit2022-05-302-8/+3
| | | | | | | | Use ShouldUseColor to set use_color instead of having a separate check for the windows mobile cases; these cases are now moved directly to `DoIsATTY`
* | Remove undefined internal function.Abseil Team2022-06-091-8/+0
|/ | | | | | | Fixes #3856 PiperOrigin-RevId: 453992227 Change-Id: I5f3330a454bdcd6b0522ebba4cdfe2c888f8e638
* Add clarifying comments about when to use EXPECT_NONFATAL_FAILURE vs. ↵Abseil Team2022-05-121-4/+6
| | | | | | | EXPECT_FATAL_FAILURE. PiperOrigin-RevId: 448237839 Change-Id: Id6242f278912f8c47cf19e3ea8c061f8b18ba832
* Do a consistent way of searching for a temporary directory.Abseil Team2022-05-111-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | The way temporary directories were discovered from environment variables in different operating systems was inconsistent. On Windows, only the system-specific environment variable TEMP was considered, but not the bazel-common TEST_TMPDIR. On Unix, only TEST_TMPDIR was considered, but not the otherwise typical system specific TMPDIR. Now, always consider TEST_TMPDIR first, followed by the system-typical environment variable (TEMP on Windows, TMPDIR on Unix) before falling back to a default on that particular system. Also: the value for the temporary directory coming from the environment variable was only checked for a trailing directory separator on Windows (and appended if needed), not on the other platforms. Make this also consistent accross the systems: Now always apply the same logic to all of these (to accomodate tests that just concatenate TempDir() without directory separator). PiperOrigin-RevId: 447909830 Change-Id: I9ea17acdf5944eb2a965615fd9cf142878c33a58
* Fixup some missing overrides in googletest.Abseil Team2022-05-101-2/+2
| | | | | | | | | This CL adds a couple missing overrides in the googletest sources. These were found downstream when -Wsuggest-override and -Wsuggest-destructor-override were enabled. PiperOrigin-RevId: 447754883 Change-Id: I7bf35a8757cbc5ae157827037aa3d13f47392406
* Merge pull request #3818 from joshiayush:typoCopybara-Service2022-05-061-3/+3
|\ | | | | | | | | PiperOrigin-RevId: 447003874 Change-Id: Ide8d879f6c939dbf4c10cc6d515c175d9b691e0c
| * Fix typo in the test name of `NormalizeTest`refs/pull/3818/headAyush Joshi2022-04-301-3/+3
| | | | | | | | Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
* | Use TEST_TMPDIR on MacOS as well if available.Abseil Team2022-05-031-2/+2
|/ | | | | | | | | | | | | | | Currently MacOS falls back to generic /tmp, but for all intents and purposes it should behave like other Unixes using the TEST_TMPDIR environment variable if available (this environment variable is set in bazel, which sets up a unique temp directory for the test process). While at it, remove an incorrect #endif comment, that looks like a leftover from some older implementation. PiperOrigin-RevId: 446108391 Change-Id: I118eacf6e86a41d26cb81a130f7c54cccc0c5665
* Use RE2 for the regex implementation when building with Bazel and using AbseilDerek Mauro2022-04-262-35/+45
| | | | | | | | | | | | | | | | | | | bazel build --define=absl=1 ... A dependency on RE2 is now required when building GoogleTest with Abseil. Using RE2 will provide a consistent cross-platform regex experience. Users will need to add the com_googlesource_code_re2, bazel_skylib, and platforms repository to their WORKSPACE files. See our WORKSPACE file in the root directory of this project for an example of how to add the dependencies. Please note that the com_googlesource_code_re2 dependency must use a commit from the `abseil` branch of the project: https://github.com/google/re2/tree/abseil PiperOrigin-RevId: 444650118 Change-Id: I45c55b26684c0c50d721a05b81c5f8a0c092400f
* Merge pull request #3797 from glandium:issue3514Copybara-Service2022-04-261-3/+4
|\ | | | | | | | | PiperOrigin-RevId: 444444700 Change-Id: I8ac5cc96cc6eb9d583fa7e3fb304ef3dcaa95b5b
| * Always initialize fields in MatcherBase constructorsrefs/pull/3797/headMike Hommey2022-04-201-3/+4
| | | | | | | | | | | | This fixes -Wuninitialized warnings with GCC. Fixes #3514.
* | Remove the legacy internal GTEST_DISALLOW_* macrosDerek Mauro2022-04-2215-113/+189
| | | | | | | | | | PiperOrigin-RevId: 443715444 Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
* | Eliminate the legacy GTEST_COMPILE_ASSERT_ macroDerek Mauro2022-04-212-29/+16
|/ | | | | PiperOrigin-RevId: 443462203 Change-Id: I0c43f981663a7531ff5da4d4be01fb3d6762273d
* Use the Abseil flags library when Abseil is presentDerek Mauro2022-04-046-88/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | When built with `--define=absl=1` under Bazel, GoogleTest flags use ABSL_FLAG instead of GoogleTest's own implementation. There are some minor behavior differences in this mode. The most notable difference is that unrecognized flags result in a flag parsing error, and are not returned to the user though a modified argc/argv, unless they appear after the positional argument delimiter ("--"). For example, to pass a non-Abseil flag, you would have to do ./mytest --gtest_color=false -- --myflag=myvalue The documentation at https://abseil.io/docs/cpp/guides/flags may be helpful in understanding the behavior. There are some other minor differences. For example, passing --help results in the program returning 1 instead of 0. https://github.com/google/googletest/issues/3646 PiperOrigin-RevId: 439312700 Change-Id: Id696a25f50f24a5b1785c45ca8fa59794f86fd5c
* Merge pull request #3779 from messerb5467:promote-inclusive-behaviorCopybara-Service2022-03-223-3/+3
|\ | | | | | | | | PiperOrigin-RevId: 436579789 Change-Id: I19faae341027efba83f1c2b3839636fc95780fc7
| * Merge branch 'main' into promote-inclusive-behaviorrefs/pull/3779/headBrad Messer2022-03-18100-5189/+4245
| |\
| * | Remove sanity as it is offensive to neurodiverse individuals.Brad Messer2022-03-183-3/+3
| | |
* | | Only print disabled test banner if the test matches gtest_filterAbseil Team2022-03-222-1/+32
| |/ |/| | | | | | | | | | | | | Currently, the "[ DISABLED ]" banner is printed for every test in a suite. When iterating on a single test gtest_filter this is very noisy. PiperOrigin-RevId: 436489088 Change-Id: If337087a7a0986b073fabf2b0a55d26485eb5c37
* | Running clang-format over all of GoogleTestAbseil Team2022-03-1594-5152/+4130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few tests are examining code locations and looking af the resulting line numbers to verify that GoogleTest shows those to users correctly. Some of those locations change when clang-format is run. For those locations, I've wrapped portions in: // clang-format off ... // clang-format on There may be other locations that are currently not tickled by running clang-format. PiperOrigin-RevId: 434844712 Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
* | Merge pull request #3774 from sobczyk:mainCopybara-Service2022-03-157-37/+115
|\ \ | |/ |/| | | | | PiperOrigin-RevId: 434738675 Change-Id: I7c8de4004bac6b750674d19e3e79c0695a42652e
| * Adjust xml and json unit tests to test for source file and line location.Szymon Sobik2022-03-084-32/+100
| |
| * Add support for testing of xml and json output of source file and line locationSzymon Sobik2022-03-082-0/+6
| |
| * Output source file path and line number in xml and json files.Szymon Sobik2022-03-081-5/+9
| | | | | | | | | | It outputs the location of testcase only. Standalone EXPECT will have no location.
* | Remove references to deleted script gen_gtest_pred_impl.pyDino Radakovic2022-03-142-6/+0
|/ | | | | PiperOrigin-RevId: 434464892 Change-Id: Iaa2277f26d0049b3d792e87f64679774a28205c6
* Address conversion warning by explicitly casting to size_tAbseil Team2022-02-141-1/+3
| | | | | | | Closes #3762 PiperOrigin-RevId: 428593750 Change-Id: Ifac216568fbc7d999adb71996ec6a1bbe3b97412
* Merge pull request #3751 from noiseless:gtest-help-test-OpenBSDCopybara-Service2022-02-081-1/+2
|\ | | | | | | | | PiperOrigin-RevId: 427207981 Change-Id: Ib93f8f61bf568d4651f9148fbc522288308c0d71
| * Fix gtest-help-test failure on OpenBSDrefs/pull/3751/headAndrew Krasavin2022-02-051-1/+2
| |
* | Merge pull request #3746 from ↵Copybara-Service2022-02-081-3/+21
|\ \ | | | | | | | | | | | | | | | | | | IYP-Programer-Yeah:use-constant-time-lookup-for-exact-match PiperOrigin-RevId: 427179775 Change-Id: I9928be2421d559acf0e0f03643ce0b856b63f737
| * | Apply requested changes by using std::inserter with move.refs/pull/3746/headHossein Ghahramanzadeh2022-02-051-9/+11
| | |
| * | Do constant time matching for exact match filters.Hossein Ghahramanzadeh2022-01-311-3/+16
| | |
* | | Merge pull request #3617 from Bagira80:fix_3616Copybara-Service2022-02-071-2/+3
|\ \ \ | |_|/ |/| | | | | | | | PiperOrigin-RevId: 426976022 Change-Id: Ib9f49cf84775a50cbc806d331349e61a1060b498
| * | CMake: Fix values of INTERFACE_INCLUDE_DIRECTORIES propertyrefs/pull/3617/headDeniz Bahadir2021-10-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace semicolon by `$<SEMICOLON>` in generator-expressions of target property `INTERFACE_INCLUDE_DIRECTORIES` of CMake targets `gtest`, `gtest_main`, `gmock` and `gmock_main`. Fixes: #3616 Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
* | | GetCurrentOsStackTraceExceptTop (both the method of UnitTestImpl and the ↵Abseil Team2022-02-013-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | wrapper function in gtest.cc) rely on the fact that the inner call is not getting optimized. This CL annotates them with the appropriate attributes. PiperOrigin-RevId: 425663217 Change-Id: Ib9ec2a69a7dd98d37640b56d4d7798572da66669
* | | Merge pull request #3744 from danger89:patch-2Copybara-Service2022-02-011-1/+1
|\ \ \ | |_|/ |/| | | | | | | | PiperOrigin-RevId: 425519462 Change-Id: I196b22675e471f66929c1cdd0f85a405ebac8484
| * | Let me give a change to try it again - updating to latest versionrefs/pull/3744/headMelroy van den Berg2022-01-251-1/+1
| | |
* | | Finish some missed pieces of the TestCase to TestSuite MigrationDerek Mauro2022-01-283-13/+13
|/ / | | | | | | | | PiperOrigin-RevId: 424864779 Change-Id: Iac5cafa3568f5fe41c85c52d28f7d61845f76868
* | Make recreate_environments_when_repeating=false the default.Abseil Team2022-01-254-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that global test environments are by default set up and torn down once, regardless of the value of the repeat flag. The point of global environments is to be set up and torn down once, and shared by all tests in the process. There is no obvious reason why multiple runs of the same test should be treated distinctly from single runs of different tests. Having this be false by default means that repeats using a global environment run faster. It can still be set to true if it's desired that every repeat get a fresh environment, but this seems less important given the nature of a global environment. Every test I've seen using a global environment uses it to set up some expensive external resource, not something that can/should be set up for each test anew. (Again this is unsurprising, since the environment is a global.) PiperOrigin-RevId: 424003937 Change-Id: I9e8a825cb8900960dd65b85fe5ffcc0a337e57f3
* | Merge pull request #3732 from joshiayush:i2174Copybara-Service2022-01-241-4/+0
|\ \ | | | | | | | | | | | | PiperOrigin-RevId: 423906844 Change-Id: I1c34a3ce8a5c761ef9f1d7ce48bef8826742e97d
| * | FIX #2174 -- remove `DEBUG_POSTFIX`refs/pull/3732/headAyush Joshi2022-01-131-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | while this is not synced with the pkg-config file, it only breaks things Fix #2174 Signed-off-by: Ayush Joshi <ayush854032@gmail.com>
* | | Merge pull request #3615 from IYP-Programer-Yeah:fix-per-test-filter-processingCopybara-Service2022-01-211-51/+94
|\ \ \ | | | | | | | | | | | | | | | | PiperOrigin-RevId: 423326942 Change-Id: I913f31960d7917b176c9f390424630708473837a
| * | | Fix a typo in comments.refs/pull/3615/headHossein Ghahramanzadeh2022-01-061-1/+1
| | | |
| * | | Use normal for loop instead of accumulate.Hossein Ghahramanzadeh2022-01-061-5/+5
| | | |
| * | | Improve code readablity.Hossein Ghahramanzadeh2022-01-061-2/+2
| | | |
| * | | Apply requested changes to preserve old behavior.Hossein Ghahramanzadeh2022-01-061-13/+20
| | | |
| * | | Reimplement MatchesFilter with new interfaces.Hossein Ghahramanzadeh2022-01-062-0/+9
| | | |
| * | | Apply requested changes.Hossein Ghahramanzadeh2022-01-061-38/+34
| | | |
| * | | Get rid of redundant filter matching codeHossein Ghahramanzadeh2022-01-062-52/+1
| | | |
| * | | Add comments describing the behavior of filtersHossein Ghahramanzadeh2022-01-061-1/+13
| | | |
| * | | Process filter string once instead of per testHossein Ghahramanzadeh2022-01-061-8/+73
| | | |