1. 01 Feb, 2022 1 commit
    • Abseil Team's avatar
      GetCurrentOsStackTraceExceptTop (both the method of UnitTestImpl and the... · 25ad42aa
      Abseil Team authored
      GetCurrentOsStackTraceExceptTop (both the method of UnitTestImpl and the 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
      25ad42aa
  2. 25 Jan, 2022 1 commit
    • Abseil Team's avatar
      Make recreate_environments_when_repeating=false the default. · f45d5865
      Abseil Team authored
      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
      f45d5865
  3. 19 Jan, 2022 1 commit
  4. 06 Jan, 2022 9 commits
  5. 01 Jan, 2022 1 commit
  6. 04 Dec, 2021 1 commit
  7. 10 Nov, 2021 1 commit
    • dmauro's avatar
      Googletest export · 6c8a3865
      dmauro authored
      Explicitly used unsigned chars for testing for valid XML characters
      
      PiperOrigin-RevId: 408692969
      6c8a3865
  8. 01 Nov, 2021 1 commit
    • lmat's avatar
      Re #3637 Show Disabled Tests in testing output · 3c958ac4
      lmat authored
      Showing disabled tests is implemented by a new member function on the
      TestEventListener interface (which is responsible for printing
      testing output). The new function is called OnTestSkipped and it is
      invoked when a disabled test is encountered.
      
      The PrettyUnitTestResultPrinter has the canonical implementation of this
      new function. The BriefUnitTestResultPrinter and the
      EmptyTestEventListener get a nullary implementation. The
      JsonUnitTestResultPrinter and XmlUnitTestResultPrinter
      inherit that trivial implementation from the EmptyTestEventListener.
      3c958ac4
  9. 23 Sep, 2021 1 commit
    • Abseil Team's avatar
      Googletest export · 0570d97f
      Abseil Team authored
      Do not attempt to continue running a test suite if it already failed during
      `SetUpTestSuite`.
      The suite already failed and running the tests might just add noise to the run, or even crash the process unnecessarily.
      
      Fixes #2187
      
      PiperOrigin-RevId: 397770405
      0570d97f
  10. 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
  11. 06 Aug, 2021 1 commit
  12. 24 Jul, 2021 1 commit
  13. 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
  14. 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
  15. 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
  16. 15 Apr, 2021 1 commit
  17. 14 Apr, 2021 1 commit
  18. 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
  19. 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
  20. 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
  21. 05 Feb, 2021 1 commit
  22. 06 Jan, 2021 1 commit
  23. 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
  24. 05 Dec, 2020 1 commit
  25. 14 Nov, 2020 1 commit
  26. 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
  27. 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
  28. 08 Nov, 2020 1 commit
  29. 20 Oct, 2020 1 commit
  30. 24 Sep, 2020 1 commit
    • 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