Repository navigation
Ut improvements - #237
Closed
mcmarius wants to merge 2 commits into
Closed
Ut improvements#237mcmarius wants to merge 2 commits into
mcmarius wants to merge 2 commits into
Conversation
mcmarius
force-pushed
the
ut-improvements
branch
from
October 4, 2026 23:51
796c90a to
de7b96e
Compare
mcmarius
marked this pull request as ready for review
October 4, 2026 23:51
Needed by ctest registering one test per case: - parse_arg_with_fallback cleared the command line captured by the cmd_line_args constructor (GCC/Clang) and by __argv (MSVC), so an executable that runs the suites from a destructor, the default here, had no option working: --help, --list-test-names-only, selecting a case by name - find_arg matched option names as substrings, so an unknown option matched nothing, became a test name pattern and the run reported success: a typo in the listing arguments of tests/CMakeLists.txt registered nothing and passed
Ported from fix-gtest, with the googletest specific parts turned into arguments, so these files are identical for any test framework: * cmake/RegisterTests.cmake / cmake/RegisterTestsAddTests.cmake: how to list the test cases and how to select one are arguments of register_tests(); without LIST_ARGS an executable is registered as a single test, which is all a plain assert() based test needs * discovery runs inside ctest, never as part of the build; working directory, per test timeout and refusing to report success for zero tests as in fix-gtest * tests/CMakeLists.txt: test target out of the root CMakeLists, one switch for tests, BUILD_TESTING * scripts/run_tests.sh, scripts/cmake.sh: copied from fix-gtest unchanged * tests/main.cpp: ut runs the suites from a destructor, where it does not see argv, so every option, the case listing and the case selection included, was ignored; it now runs them from main * test case names must be unique across suites, and a name holding a wildcard character is refused: it selects another case, or none, and reports success Rename lib, static linking Disable asan on tests Fix static linking Backport from main Trim prose
mcmarius
force-pushed
the
ut-improvements
branch
from
October 4, 2026 23:53
de7b96e to
6a94555
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.