Skip to content

Conversation

@hsaunders1904
Copy link

Prevents messages from skipped tests being displayed when the --gtest_brief flag is set.

Resolves #4548

Using this example:

// test.cpp
#include <gtest/gtest.h>

TEST(Test, TwoAndTwoIsFour) { 
  GTEST_SKIP();
  EXPECT_EQ(2 + 2, 4); 
}

TEST(Test, FiveAndFiveIsTen) {
  GTEST_SKIP() << "user message";
  EXPECT_EQ(5 + 5, 10);
}

Before:

$ ./test --gtest_brief=1
.../test.cpp:5: Skipped


.../test.cpp:10: Skipped
user message

[==========] 2 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 0 tests.
[  SKIPPED ] 2 tests.

After:

$ ./test --gtest_brief=1
[==========] 2 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 0 tests.
[  SKIPPED ] 2 tests.

@google-cla
Copy link

google-cla bot commented Jul 5, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Roman-
Copy link

Roman- commented Jul 9, 2025

This is a perfect MR with minimal code changes that fixes an annoying GTest issue. @google please just merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Skipped tests' messages are displayed in brief mode

2 participants