Skip to content

Ut improvements - #237

Closed
mcmarius wants to merge 2 commits into
tests/Boost-ext-utfrom
ut-improvements
Closed

mcmarius wants to merge 2 commits into
tests/Boost-ext-utfrom
ut-improvements

Conversation

@mcmarius

@mcmarius mcmarius commented Oct 4, 2026

Copy link
Copy Markdown
Owner

No description provided.

@mcmarius
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 mcmarius closed this Oct 4, 2026
@mcmarius
mcmarius deleted the ut-improvements branch October 4, 2026 23:56
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.

1 participant