To see a list of supported flags and their usage, please run your test program
with the --help flag. You can also use -h, -?, or /? for short.
However, executables only check for the --help flag (and not the short-hand variants):
// ...
} else if (arg_string == "--help" || HasGoogleTestFlagPrefix(arg)) {
// Both help flag and unrecognized Google Test flags (excluding
// internal ones) trigger help display.
g_help_flag = true;
}
// ...
Steps to reproduce the problem
Reproduce as follows:
Build any google test executable
Run it with -h, -?, or /?
Observe that tests execute, and no help text is printed.
What version of GoogleTest are you using?
Latest version of google test, v1.14.0, although this bug applies to much older versions as well.
Output of git rev-parse HEAD: 1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2
What operating system and version are you using?
MacOS, although this bug applies to all platforms.
What compiler and version are you using?
This isn't relevant to the bug, as it applies to all platforms, however the output is:
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
What build system are you using?
cmake version 3.29.6
CMake suite maintained and supported by Kitware (kitware.com/cmake).
Describe the issue
The documentation: states that the following flags are supported:
However, executables only check for the
--help
flag (and not the short-hand variants):Steps to reproduce the problem
Reproduce as follows:
-h
,-?
, or/?
What version of GoogleTest are you using?
Latest version of google test, v1.14.0, although this bug applies to much older versions as well.
Output of
git rev-parse HEAD
:1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2
What operating system and version are you using?
MacOS, although this bug applies to all platforms.
What compiler and version are you using?
This isn't relevant to the bug, as it applies to all platforms, however the output is:
What build system are you using?
Additional context
I've provided a fix in PR #4563