1. 18 Feb, 2021 1 commit
    • Abseil Team's avatar
      Googletest export · daa0df7b
      Abseil Team authored
      Explicitly skip tests after fatal global environment setup errors
      
      Previously the tests were all skipped, but the resulting output claimed all
      tests passed.
      
      Before:
      ```
      [----------] Global test environment set-up.
      <failure message>
      [----------] Global test environment tear-down
      [==========] 1 test from 1 test suite ran. (83 ms total)
      [  PASSED  ] 1 test.
      [  FAILED  ] 0 tests, listed below:
      ```
      
      After:
      ```
      [==========] Running 1 test from 1 test suite.
      [----------] Global test environment set-up.
      <failure message>
      [----------] 1 test from SomeTest
      [ RUN      ] SomeTest.DoesFoo
      <...>: Skipped
      [  SKIPPED ] SomeTest.DoesFoo (0 ms)
      [----------] 1 test from SomeTest (0 ms total)
      
      [----------] Global test environment tear-down
      [==========] 1 test from 1 test suite ran. (68 ms total)
      [  PASSED  ] 0 tests.
      [  SKIPPED ] 1 test, listed below:
      [  SKIPPED ] SomeTest.DoesFoo
      [  FAILED  ] 0 tests, listed below:
      ```
      
      PiperOrigin-RevId: 358026389
      daa0df7b
  2. 05 Feb, 2021 1 commit
  3. 06 Jan, 2021 1 commit
  4. 03 Jan, 2021 1 commit
    • Krystian Kuzniarek's avatar
      remove explicit function overloads of CmpHelper?? for BiggestInt arguments · 100ffc33
      Krystian Kuzniarek authored
      Affects macros {ASSERT|EXPECT}_{EQ|NE|LE|LT|GE|GT}.
      
      According to removed comments, these overloads were supposed to reduce
      code bloat and allow anonymous enums on GCC 4.
      
      However, the way it works on GCC 4 and the latest GCC (10.2 by now) is
      that having:
      
      template <typename T1, typename T2>
      void foo(T1, T2);
      
      using BiggestInt = long long;
      void foo(BiggestInt, BiggestInt);
      
      the template version takes precedence for almost every combination of
      integral types except for two long long integers - i.e. implicit
      promotion to long long is a worse match than generating a specific
      template function.
      
      Tested on GCC 4.8.1 (as GoogleTest requires C++11 and this was
      the first C++11 feature-complete release of GCC),
      GCC 4.8.5 (last of 4.8.x series) and the latest GCC (10.2.0).
      100ffc33
  5. 05 Dec, 2020 1 commit
  6. 14 Nov, 2020 1 commit
  7. 12 Nov, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · 0e202cdb
      Abseil Team authored
      Use environment variable TEST_TMPDIR in Linux environments
      for temporary directory if available otherwise use /tmp/.
      
      Bazel sets the environment variable TEST_TMPDIR when launching tests.
      
      PiperOrigin-RevId: 342058921
      0e202cdb
  8. 11 Nov, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · b4999a1e
      Abseil Team authored
      Remove unreachable code when GTEST_CUSTOM_TEMPDIR_FUNCTION_ is defined.
      
      PiperOrigin-RevId: 341810264
      b4999a1e
  9. 08 Nov, 2020 1 commit
  10. 20 Oct, 2020 1 commit
  11. 24 Sep, 2020 2 commits
    • Abseil Team's avatar
      Googletest export · fe4d5f10
      Abseil Team authored
      Revision of recent DoubleNearPredFormat change to support more toolchains.
      
      isnan() is a macro in C99, and std::isnan() is a function in C++11.  The previous change used `isnan` directly, and broke some tests in open source.
      
      This CL changes it to follow the practice in gmock-matchers.h, and spell uses of isnan as
        (std::isnan)(f)
      .  The parens around `std::isnan` prevent it from being recognized as a macro in the preprocessor.
      
      PiperOrigin-RevId: 333374377
      fe4d5f10
    • Abseil Team's avatar
      Googletest export · b5687db5
      Abseil Team authored
      Improve DoubleNearPredFormat output on bad epsilons
      
      DoubleNearPredFormat will happily accept epsilon values (abs_error) that
      are so small that they are meaningless. This turns EXPECT_NEAR into a
      complicated and non-obvious version of EXPECT_EQ.
      
      This change modifies DoubleNearPredFormat) so that when there is a
      failure it calculates the smallest meaningful epsilon value, given the
      input values, and then prints a message which explains what happened.
      
      If a true equality test is wanted either pass a literal 0.0 as abs_error
      or use EXPECT_EQ. If a check for being almost equal is wanted consider
      using EXPECT_DOUBLE_EQ which, contrary to its name, verifies that the
      two numbers are *almost* equal (within four ULPs).
      
      With this change the flaky test mentioned in crbug.com/786046 gives this
      output:
      
      The difference between 4.2934311416234112e+18 and 4.2934311416234107e+18 is 512, where
      4.2934311416234112e+18 evaluates to 4.2934311416234112e+18,
      4.2934311416234107e+18 evaluates to 4.2934311416234107e+18.
      The abs_error parameter 1.0 evaluates to 1 which is smaller than the minimum distance between doubles for numbers of this magnitude which is 512, thus making this EXPECT_NEAR check equivalent to EXPECT_EQUAL. Consider using EXPECT_DOUBLE_EQ instead.
      
      Tested:
      I confirmed that this change detects the bad epsilon value that caused
      crbug.com/786046 in Chromium and added a test for the desired output.
      PiperOrigin-RevId: 332946880
      b5687db5
  12. 08 Sep, 2020 1 commit
    • dmauro's avatar
      Googletest export · 5f8fcf4a
      dmauro authored
      Implements GetTimeInMillis() using std::chrono for portability
      Fixes #2995
      
      PiperOrigin-RevId: 329709958
      5f8fcf4a
  13. 01 Sep, 2020 2 commits
    • Abseil Team's avatar
      Googletest export · 7b1cf6dd
      Abseil Team authored
      gtest.cc: make ColoredPrintf static
      
      the prototype was removed from gtest.h in cl/301446904; quiets a
      -Wmissing-declarations warning
      
      PiperOrigin-RevId: 329569020
      7b1cf6dd
    • Abseil Team's avatar
      Googletest export · af1e75ce
      Abseil Team authored
      Add millisecond precision to start timestamp in XML/JSON output
      
      - Previous timestamp had format YYYY-MM-DDThh:mm:ss, now YYYY-MM-DDThh:mm:ss.sss
      - This conforms to the ISO 8601 standard
      
      PiperOrigin-RevId: 329503623
      af1e75ce
  14. 28 Jul, 2020 1 commit
  15. 18 Jun, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · c6e309b2
      Abseil Team authored
      gtest.cc: fix a couple typos
      
      s/paramaterized/parameterized/
      
      PiperOrigin-RevId: 316878900
      c6e309b2
  16. 10 Jun, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · ec94d9f2
      Abseil Team authored
      Fail TEST_Ps or TYPED_TEST_Ps that are defined but are not instantiated, as well as the opposite case, where INSTANTIATE_TEST_SUITE_P or INSTANTIATE_TYPED_TEST_SUITE_P is used but without any matching TEST_P or TYPED_TEST_P.
      
      PiperOrigin-RevId: 315255779
      ec94d9f2
  17. 08 May, 2020 2 commits
    • Martin Storsjö's avatar
      Remove an explicit include of debugapi.h · d86e9e23
      Martin Storsjö authored
      The documentation for IsDebuggerPresent says that one just should
      include windows.h, as that one is an umbrella header that includes
      the header that declares IsDebuggerPresent. In older Windows SDKs,
      debugapi.h didn't exist and IsDebuggerPresent was declared in
      winbase.h (also included by windows.h).
      
      This should fix issue #2822 properly.
      d86e9e23
    • Martin Storsjö's avatar
      Revert "Googletest export" · 09f58751
      Martin Storsjö authored
      This reverts commit a9f6c1ed.
      
      That commit cannot fix the issue it sets out to fix.
      
      The original issue, #2822, was that building with a toolset
      targeting XP compatibility is missing the debugapi.h header -
      as debugapi.h didn't exist in older Windows SDKs.
      
      Commit a9f6c1ed misinterpreted
      the Microsoft documentation about IsDebuggerPresent. The information
      about which header to use, "debugapi.h (include Windows.h)" means
      that the function declaration currently lives in debugapi.h, but
      for compatibility, just include the Windows.h umbrella header.
      In older Windows SDKs (e.g. the v6.0a SDK), IsDebuggerPresent
      is declared in winbase.h, and debugapi.h doesn't exist at all in those
      versions.
      
      Including Windows.h with a different capitalization than the existing
      include won't help finding headers that don't exist.
      
      Including Windows.h with a capital W breaks cross compilation with mingw
      toolchains, where the header always has been spelled with a lower case
      W. When building on native windows, the file system is case insensitive
      and the capitalization doesn't matter.
      
      This fixes issue #2840.
      09f58751
  18. 05 May, 2020 1 commit
  19. 09 Apr, 2020 1 commit
  20. 29 Mar, 2020 1 commit
  21. 26 Mar, 2020 3 commits
  22. 24 Mar, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · 1ced315a
      Abseil Team authored
      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
      1ced315a
  23. 19 Mar, 2020 1 commit
  24. 17 Mar, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · 482ac6ee
      Abseil Team authored
      Move internal function out of header because Hyrum's law always wins.
      
      PiperOrigin-RevId: 301446904
      482ac6ee
  25. 28 Feb, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · e588eb1f
      Abseil Team authored
      Rename internal color enumerators to avoid conflicts with curses.h macro definitions.
      Fixes #2685
      
      PiperOrigin-RevId: 297639382
      e588eb1f
  26. 21 Feb, 2020 1 commit
  27. 21 Jan, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · 18b67bfc
      Abseil Team authored
      Add extra filtering so that the reported message differentiates between the case where INSTANTIATE_TEST_SUITE_P is missing vs. the case where TEST_P is missing.
      
      PiperOrigin-RevId: 290114508
      18b67bfc
  28. 16 Jan, 2020 4 commits
    • Abseil Team's avatar
      Googletest export · 8b4817e3
      Abseil Team authored
      Correct the spelling of PARAMETERIZED.
      
      PiperOrigin-RevId: 289897278
      8b4817e3
    • Abseil Team's avatar
      Googletest export · 3e79d366
      Abseil Team authored
      Wire up things to support marking a type paramaterized test as allowed to be un-instantiated.
      
      PiperOrigin-RevId: 289699939
      3e79d366
    • Abseil Team's avatar
      Googletest export · 0b024bd9
      Abseil Team authored
      Add GTEST_ALLOW_UNINSTANTIATED_PARAMTERIZED_TEST to mark a paramaterized test as allowed to be un-instantiated.
      
      This allows test suites, that are defined in libraries and, for other reasons, get linked in (which should probably be avoided, but isn't always possible) to be marked as allowed to go uninstantiated.
      
      This can also be used to grandfather existing issues and expedite adoption of the checks with regards to new cases before they can be fixed.
      
      PiperOrigin-RevId: 289581573
      0b024bd9
    • Abseil Team's avatar
      Googletest export · ed16134f
      Abseil Team authored
      Change testing::TempDir() return value for Android
      
      PiperOrigin-RevId: 289102017
      ed16134f
  29. 02 Jan, 2020 1 commit
    • Abseil Team's avatar
      Googletest export · a13a0626
      Abseil Team authored
      Add option (default to disabled) to make C++ type parameterized tests (TYPED_TEST_P) fail when they're not instantiated.
      
      When an un-instantiated TYPED_TEST_P is found, a new test will be inserted that emits a suitable message. For now, that is just a notice, but the hope it to flip the bit to make it fail by default.
      
      PiperOrigin-RevId: 286408038
      a13a0626
  30. 13 Dec, 2019 1 commit
    • Abseil Team's avatar
      Googletest export · d442089d
      Abseil Team authored
      Detect when C++ parametric tests (TEST_P) are not instantiated.
      
      When an un-instantiated TEST_P is found, a new test will be inserted that will emit a warning message.
      
      This can be made to error with minor code edits.
      In the future, that is intended to be the default.
      
      PiperOrigin-RevId: 284901666
      d442089d
  31. 06 Dec, 2019 1 commit
    • Abseil Team's avatar
      Googletest export · 9ed99c6c
      Abseil Team authored
      Change googletest to notice failures during SetUpTestSuite() and TearDownTestSuite().
      
      Previously, errors that occurred during those functions were logged but otherwise ignored. After this change, such failures will cause the test to fail and a brief summary will be printed at the bottom of the test log.
      
      See https://github.com/google/googletest/issues/2330.
      
      PiperOrigin-RevId: 284033342
      9ed99c6c
  32. 22 Nov, 2019 1 commit
    • Abseil Team's avatar
      Googletest export · 717ce7fe
      Abseil Team authored
      Use standard C++11 integer types in gtest-port.h.
      
      Remove testing::internal::{Int,Uint}{32,64} in favor of types
      guaranteed to be in <cstdint> since C++11.
      
      Tests for built-in integer type coverage are switched from
      {Int,Uint}64 to [unsigned] long long, which is guaranteed by
      C++11 to exist and be at least 64-bit wide.
      
      PiperOrigin-RevId: 281565263
      717ce7fe