1. 14 Sep, 2021 1 commit
    • Abseil Team's avatar
      Googletest export · 159c9ad2
      Abseil Team authored
      Avoid segfault on null premature_exit_filepath.
      
      PiperOrigin-RevId: 395965853
      159c9ad2
  2. 06 Aug, 2021 1 commit
  3. 24 Jul, 2021 1 commit
  4. 22 Jul, 2021 1 commit
    • Abseil Team's avatar
      Googletest export · 96f4ce02
      Abseil Team authored
      Delete GOOGLETEST_CM.* tags from C++ code.
      
      PiperOrigin-RevId: 386268534
      96f4ce02
  5. 07 Jul, 2021 2 commits
    • Abseil Team's avatar
      Googletest export · 977cffc4
      Abseil Team authored
      Introduce GTEST_FLAG_GET and GTEST_FLAG_SET macros.
      
      PiperOrigin-RevId: 382808313
      977cffc4
    • Abseil Team's avatar
      Googletest export · 4cfd1498
      Abseil Team authored
      gtest: Add a flag to only set up/tear down test environments once when repeating
      
      Currently when running a test multiple times using `--gtest_repeat` the global
      test environment(s) are set up and torn down for each iteration of the test.
      When checking for flakes in tests that have expensive dependencies that are set
      up in the test environment (subprocesses, external dependencies, etc) this can
      become expensive.
      
      To support finding flakes in tests that fit into this category, where the setup
      phase is expensive but each test case is fast, allow callers to specify via
      `--gtest_recreate_environments_when_repeating=false` that the test environments
      should only be set up once, for the first iteration, and only torn down once, on
      the last iteration. This makes running a test with `--gtest_repeat=1000` a much
      faster and more pleasant experience.
      
      PiperOrigin-RevId: 382748942
      4cfd1498
  6. 17 Apr, 2021 1 commit
    • dmauro's avatar
      Googletest export · eaf9a3fd
      dmauro authored
      Use the time_point from steady_clock instead of the template
      This fixes the build on some embedded compilers
      
      PiperOrigin-RevId: 368879480
      eaf9a3fd
  7. 15 Apr, 2021 1 commit
  8. 14 Apr, 2021 1 commit
  9. 16 Mar, 2021 1 commit
    • Abseil Team's avatar
      Googletest export · ac1d60c2
      Abseil Team authored
      gtest: Output a canned test suite for environment failures in XML/JSON
      
      This surfaces useful information about the environment failure in a structured form.
      
      As we can see from the updated test, previously unsurfaced information is now present.
      
      PiperOrigin-RevId: 362292322
      ac1d60c2
  10. 09 Mar, 2021 2 commits
    • Abseil Team's avatar
      Googletest export · 763eaa43
      Abseil Team authored
      Use monotonic time to measure test duration
      
      System time may be updated while a test is running. When this occurs a
      duration measured using system time may appear to move backwards, or
      jump far forwards.
      This change updates the duration measurement to use monotonic time
      instead. Timestamps for the test start still use system time.
      
      PiperOrigin-RevId: 361700881
      763eaa43
    • Abseil Team's avatar
      Googletest export · bb4f87e6
      Abseil Team authored
      gtest.cc: Split out functions for printing `TestResult` objects
      
      This will make it possible to reuse this code for outputting the "ad_hoc" `TestResult` objects in structured form in XML/JSON.
      
      PiperOrigin-RevId: 361604860
      bb4f87e6
  11. 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
  12. 05 Feb, 2021 1 commit
  13. 06 Jan, 2021 1 commit
  14. 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
  15. 05 Dec, 2020 1 commit
  16. 14 Nov, 2020 1 commit
  17. 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
  18. 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
  19. 08 Nov, 2020 1 commit
  20. 20 Oct, 2020 1 commit
  21. 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
  22. 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
  23. 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
  24. 28 Jul, 2020 1 commit
  25. 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
  26. 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
  27. 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
  28. 05 May, 2020 1 commit
  29. 09 Apr, 2020 1 commit
  30. 29 Mar, 2020 1 commit
  31. 26 Mar, 2020 3 commits
  32. 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
  33. 19 Mar, 2020 1 commit