Skip to content

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

@hsaunders1904

Description

@hsaunders1904

Describe the issue

When running tests using --gtest_brief=1, the messages produced by skipped tests are printed.

The help for gtest_brief suggests that only test failures should be displayed:

$ ./tests --help | grep gtest_brief -A1
  --gtest_brief=1
      Only print test failures. 

I expected that the output from the skipped tests would be hidden.

Steps to reproduce the problem

Add a skipped test and run the test using the --gtest_brief=1 option.

For 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);
}

Running this test outputs:

$ ./test --gtest_brief=1
Running main() from /tmp/googletest-20230913-4615-1t6szd0/googletest-1.14.0/googletest/src/gtest_main.cc
/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.

What version of GoogleTest are you using?

1.14.0

What operating system and version are you using?

OSX

What compiler and version are you using?

Apple clang version 15.0.0 (clang-1500.3.9.4)

What build system are you using?

cmake version 3.29.2

Additional context

I have a patch that resolves this issue. I'm happy to open a PR if you're open to the change.

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