google / google/googletest

--gtest_list_tests prints incorrect test names

Open
#4,586 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

### Describe the issue

Output from `testsuite --gtest_list_tests` is structured by test suites, listing test names with indentation. This makes it impossible to compose a filter for the option `--gtest_filter`, because the precise test name is never printed, whereas incorrect (and therefore useless) test names are printed instead. Correct behavior would print the exact test name adjacent to each test, in the precise format that will match that test when using option `--gtest_filter`. This kind of problem is widely known as the "needle in a haystack design error" because the design forces users into an unproductive trial-and-error game of guessing an internal representation that cannot be discovered any easier way.

### Steps to reproduce the problem

Invoke `testsuite --gtest_list_tests` on any gtest suite.

### What version of GoogleTest are you using?

any

### What operating system and version are you using?

any

### What compiler and version are you using?

any

### What build system are you using?

any

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running `testsuite --gtest_list_tests` and compare its output with the names accepted by `--gtest_filter`. Trace the list-tests entry point and determine the exact name format expected by the filter; done means every listed test displays a directly usable filter name.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.