Commit Graph

3127 Commits

Author SHA1 Message Date
Gennadiy Civil
200ff59949 Merge pull request #2569 from bgianfo:master
PiperOrigin-RevId: 281321427
2019-11-20 14:16:54 -05:00
Abseil Team
4bf466236d Googletest export
Add a breadcrumb about nullopt comparison near the Optional() matcher.

Also add a note about how otherwise-spurious 'Eq()' may be needed in some cases. Without this, something like Field(&MyStruct::optional_field_without_equals_equals, absl::nullopt) doesn't work - it converts the nullopt to an optional<> of the non-equalable type, and fails to select the operator==(optional<>, nullopt_t) overload. The Eq() lets the type persist later into the match.

PiperOrigin-RevId: 281305519
2019-11-20 14:16:45 -05:00
Abseil Team
50cfbb726b Googletest export
Update stale comments to point to proper location.

PiperOrigin-RevId: 281157036
2019-11-19 11:25:59 -05:00
Brian Gianforcaro
0c469a5a06 Fix FlatTuple compilation on older msvc.
googletest 1.10.0 fails to compile on msvc version 19.00.23917
with one compilation error:

src\googletest\include\gtest\internal\gtest-internal.h(1188) : error C2039:
'FlatTupleBase<testing::internal::FlatTuple<bool,bool>,testing::internal::IndexSequence<0,1> >':
is not a member of 'testing::internal::FlatTuple<bool,bool>'

This PR fixes the compilation error by explicitly specifying the full type that Indices is
located in the base type.
2019-11-15 17:41:40 -08:00
Andy Getz
c27acebba3 Merge pull request #2521 from Sinclair-John:master
PiperOrigin-RevId: 280666222
2019-11-15 17:30:15 -05:00
Andy Getz
f73898f3ff Merge pull request #2554 from kuzkry:update-gen_gtest_pred_impl
PiperOrigin-RevId: 279734102
2019-11-13 17:03:54 -05:00
Andy Getz
11440f27c6 Merge pull request #2556 from ienorand:avoid-pkg-config-lpthread-cflag
PiperOrigin-RevId: 279375858
2019-11-13 17:03:46 -05:00
Abseil Team
d5707695cb Googletest export
Correctly deal with stringification, and forbid empty arguments where they could slip thought, in the type parameterized test API.

Note: even where empty args work, it's likely to result in technically invalid code by virtue of creating reserved identifiers:
https://en.cppreference.com/w/cpp/language/identifiers
PiperOrigin-RevId: 279330971
2019-11-08 15:47:19 -05:00
Abseil Team
681454dae4 Googletest export
Clone+exec death test allocates a single page of stack to run chdir + exec on.
This is not enough when gtest is built with ASan and run on particular
hardware.

With ASan on x86_64, ExecDeathTestChildMain has frame size of 1728 bytes.

Call to chdir() in ExecDeathTestChildMain ends up in
_dl_runtime_resolve_xsavec, which attempts to save register state on the stack;
according to cpuid(0xd) XSAVE register save area size is 2568 on my machine.

This results in something like this in all death tests:
  Result: died but not with expected error.
  ...
  [  DEATH   ] AddressSanitizer:DEADLYSIGNAL
  [  DEATH   ] =================================================================
  [  DEATH   ] ==178637==ERROR: AddressSanitizer: stack-overflow on address ...

PiperOrigin-RevId: 278709790
2019-11-08 15:47:12 -05:00
Xiaoyi Zhang
e08a460277 Merge pull request #2549 from kuzkry:pump-support-for-python-3
PiperOrigin-RevId: 278702666
2019-11-05 17:08:36 -05:00
Xiaoyi Zhang
8aedd597af Merge pull request #2548 from kuzkry:update-pump-manual
PiperOrigin-RevId: 278702531
2019-11-05 17:08:27 -05:00
Xiaoyi Zhang
54978626b4 Merge pull request #2547 from kuzkry:typo
PiperOrigin-RevId: 278702456
2019-11-05 17:08:18 -05:00
Xiaoyi Zhang
3e062a6efe Merge pull request #2373 from Youw:master
PiperOrigin-RevId: 278601074
2019-11-05 17:08:09 -05:00
Martin Erik Werner
6caa879a42 pkg-config: Remove pthread link flag from Cflags
Remove the threads link library variable references from the pkg-config
Cflags: field, removing -lpthread(s) from the compile flags.

"-l*" linker flags should only be part of the Libs: section and should
not be part of the Cflags: section in pkg-config files.

This was first suggested in
https://github.com/google/googletest/pull/2006 and further discussed in
https://github.com/google/googletest/pull/2483 .
2019-11-05 22:40:49 +01:00
Krystian Kuzniarek
f9665846e4 update gen_gtest_pred_impl.py
After 7bd4a7f3 gtest_pred_impl_unittest.cc used to be newer than
its template.
2019-11-05 06:53:20 +01:00
Xiaoyi Zhang
8697709e03 Merge pull request #2453 from kuzkry:gtest-port-clean-up_kMaxBiggestInt
PiperOrigin-RevId: 278008286
2019-11-04 11:43:27 -05:00
Krystian Kuzniarek
f658561ef2 fix a typo 2019-11-02 01:18:21 +01:00
Krystian Kuzniarek
442f45b376 pump.py: add support for Python 3 2019-11-02 01:13:24 +01:00
Krystian Kuzniarek
523ad489ef update pump_manual.md 2019-11-02 01:08:24 +01:00
vslashg
e8a82dc7ed Merge pull request #2453 from kuzkry:gtest-port-clean-up_kMaxBiggestInt
PiperOrigin-RevId: 277979766
2019-11-01 16:02:16 -04:00
vslashg
057ee5063d Merge pull request #2533 from thejcannon:noexcept_spec
PiperOrigin-RevId: 277924721
2019-11-01 16:02:05 -04:00
Abseil Team
2db3df9c4f Googletest export
Change variable name to match comment.

PiperOrigin-RevId: 277713621
2019-10-31 15:11:41 -04:00
Abseil Team
e2fc3a9c9c Googletest export
Tolerate std::string's explicit copy construction from std::string_view.

PiperOrigin-RevId: 277583394
2019-10-31 15:11:31 -04:00
misterg
0a03480824 Googletest export
Remove outdated unsupported scripts

PiperOrigin-RevId: 277556831
2019-10-30 16:49:09 -04:00
Ihor Dutchak
f626deda19 Added special catch for std::exception in GTEST_TEST_NO_THROW_ 2019-10-30 21:57:48 +02:00
misterg
ba33a8876c Googletest export
Internal Change

PiperOrigin-RevId: 277336786
2019-10-29 16:51:58 -04:00
mhermas
fff8dabbf6 Googletest export
Merge 65032e28cba171c000accc85ffaf6f1e62921b86 into 8c91ecef29

Closes #2470

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2470 from hermas55:bugfix/default_const_param 65032e28cba171c000accc85ffaf6f1e62921b86
PiperOrigin-RevId: 277118535
2019-10-29 16:51:49 -04:00
Abseil Team
2bee6da24e Googletest export
Editorial cleanup of the "write the main function" section

PiperOrigin-RevId: 277102507
2019-10-29 16:51:40 -04:00
Abseil Team
755f853c6b Googletest export
Avoid temporary matcher instances.
They are unnecessary and can be relatively more expensive than the rest of the
algorithm.

PiperOrigin-RevId: 277084853
2019-10-29 16:51:31 -04:00
Abseil Team
757d39a79b Googletest export
Make it clearer that users should _not_ write their own main functions.

PiperOrigin-RevId: 277079721
2019-10-29 16:51:22 -04:00
vslashg
b5fb5ba05c Merge pull request #2527 from PiotrNycz:gmock_prevent_return_ref_to_store_temporaries_2
PiperOrigin-RevId: 277061341
2019-10-29 16:51:12 -04:00
Abseil Team
a1f71dd56d Googletest export
Remove badly formatted suggestion in gmock cheat sheet.

PiperOrigin-RevId: 277060475
2019-10-29 16:51:01 -04:00
vslashg
a8b1a66cfd Merge pull request #2388 from kuzkry:remove-gtest-type-util.pump
PiperOrigin-RevId: 276944601
2019-10-29 16:50:52 -04:00
Krystian Kuzniarek
1a49b67aeb update CONTRIBUTORS 2019-10-25 17:03:39 +02:00
Krystian Kuzniarek
002905f29f move the pumping script to googlemock 2019-10-25 17:03:39 +02:00
Krystian Kuzniarek
a7083564d5 remove gtest-type-util.h.pump 2019-10-25 17:03:39 +02:00
Krystian Kuzniarek
e3a9a567d8 replace autogenerated TemplatesX classes by variadic ones 2019-10-25 17:01:50 +02:00
Krystian Kuzniarek
eed64b5fc6 replace autogenerated TypesX classes by variadic ones 2019-10-25 16:58:35 +02:00
vslashg
540835fa68 Merge pull request #2515 from ciband:feat/support_esp8266
PiperOrigin-RevId: 276333426
2019-10-25 10:21:03 -04:00
Piotr Nycz
208c2f6b60 variable names corrected (followed google coding style)
Issue 2527
2019-10-25 16:14:18 +02:00
Piotr Nycz
5ff72f5295 Apply 80chars limit
Issue 2527
2019-10-25 10:29:15 +02:00
Piotr Nycz
d072682119 Tests simplified and names corrected (POD->scalar)
Issue 2527
2019-10-24 10:22:09 +02:00
Krystian Kuzniarek
6e87238c9b remove BiggestInt 2019-10-24 08:31:26 +02:00
Abseil Team
37f3227831 Googletest export
Add a matcher `testing::ReturnRoundRobin` which, on each call, returns the next element in the sequence, restarting at the beginning once it has reached the end.

PiperOrigin-RevId: 276312136
2019-10-23 15:54:45 -04:00
Joshua Cannon
676d0444bf Revert "Merge pull request #2498 from thejcannon:noexcept_spec"
This reverts commit ba513d2c95, reversing
changes made to a3ca5b9e0b.
2019-10-23 14:46:46 -05:00
vslashg
1110c471ca Merge pull request #2522 from cloudrex:patch-1
PiperOrigin-RevId: 276271201
2019-10-23 13:35:36 -04:00
vslashg
8bab7883a6 Merge pull request #2514 from thejcannon:msvc_macro_issue
PiperOrigin-RevId: 276134684
2019-10-23 13:35:26 -04:00
Abseil Team
aa1146da81 Googletest export
Split the scoped trace examples into two snippets.

This doesn't have an effect in the github markdown renderer, but in some other renderers/templates, this leads them to be independently copy-pastable. In particular, the markdown rendering that Google uses internally has a copy button for each code snippet, which, before this change, would copy both lines. Bad copy button, no cookie! After this change, there will be two such buttons, one per line, and clicking a copy button will copy only the one snippet it is next to, and not the other. This is desirable because nobody will ever want to copy both lines, only one or the other.

PiperOrigin-RevId: 276079009
2019-10-23 13:35:16 -04:00
Piotr Nycz
37590da6c0 Added more tests to verify: ReturnRef not accept temporary
Issue 2471
2019-10-23 10:12:48 +02:00
Piotr Nycz
19a3bbce51 Added tests verifying that temporaries are accepted by ReturnRef
Issue no 2527
2019-10-22 18:41:35 +02:00