Skip to content

GTEST_SKIP() << {message} doesn't output message when executed from SetUp() fixtures #2208

@ngie-eign

Description

@ngie-eign

gtest_skip_test's Fixture tests test GTEST_SKIP() << "Fixture.SkipsAnotherTest" as part of the fixture setup:

42 class Fixture : public Test {
43  protected:
44   void SetUp() override {
45     GTEST_SKIP() << "skipping all tests for this fixture";
46   }
47 };

While it definitely works (as a general feature), the diagnostic message isn't output, confusing the end-user:

$ /home/ngie/nfs/git/googletest/googlemock/gtest/gtest_skip_test
Running main() from /home/ngie/nfs/git/googletest/googletest/src/gtest_main.cc
[==========] Running 3 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 1 test from SkipTest
[ RUN      ] SkipTest.DoesSkip
[  SKIPPED ] SkipTest.DoesSkip (0 ms)
[----------] 1 test from SkipTest (0 ms total)

[----------] 2 tests from Fixture
[ RUN      ] Fixture.SkipsOneTest
[  SKIPPED ] Fixture.SkipsOneTest (0 ms)
[ RUN      ] Fixture.SkipsAnotherTest
[  SKIPPED ] Fixture.SkipsAnotherTest (0 ms)
[----------] 2 tests from Fixture (0 ms total)

[----------] Global test environment tear-down
[==========] 3 tests from 2 test suites ran. (0 ms total)
[  PASSED  ] 0 tests.
[  SKIPPED ] 3 tests, listed below:
[  SKIPPED ] SkipTest.DoesSkip
[  SKIPPED ] Fixture.SkipsOneTest
[  SKIPPED ] Fixture.SkipsAnotherTest

Fixture.SkipsOneTest and Fixture.SkipsAnotherTest should both be outputting "Fixture.SkipsAnotherTest".

Reported by @asomers as part of https://reviews.freebsd.org/D19765 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions