refactor cmake tests: per-test CMakeLists.txt and per-call run_cmake args#90
Merged
Conversation
…args Replace the single shared configure/CMakeLists.txt (a 15-branch if/elseif ladder keyed on RunCMake_TEST) with one CMakeLists.txt per test case, so each test is self-contained and readable in isolation. Extend run_cmake() to accept extra -D flags as trailing arguments, so per-test cache-variable settings (MUTINY_TESTS_DETAILED, MUTINY_EXTRA_ARGS, etc.) are passed at the call site instead of via a stateful list(APPEND/REMOVE_ITEM RunCMake_TEST_OPTIONS) dance.
The project requires CMake 3.29 (cmake_minimum_required in CMakeLists.txt), so the TEST_INCLUDE_FILE singular-property path and its _MUTINY_CMAKE_VERSION_OVERRIDE escape hatch are unreachable dead code. Remove them along with the two tests that exercised that path.
Contributor
|
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.
Description
Replace the single shared
configure/CMakeLists.txt(a 15-branchif/elseifladder keyed onRunCMake_TEST) with oneCMakeLists.txtper test case, so each configure-time test is self-contained and readable in isolation.Extend
run_cmake()to accept trailing-Dflags as per-call options, eliminating the statefullist(APPEND/REMOVE_ITEM RunCMake_TEST_OPTIONS)pattern fromRunCMakeTest.cmake.Also removes the CMake <3.10 compatibility shim from
mu.tiny.cmake. The project already requires CMake 3.29, so theTEST_INCLUDE_FILEsingular-property path and its_MUTINY_CMAKE_VERSION_OVERRIDEescape hatch were unreachable dead code.Related Issues
N/A
Type of Change
Manual Verification (Optional)
N/A
Checklist
docs/for any user-facing changes.mu::tinynamespace,INCLUDED_MU_TINY_guards,mutiny_C-prefix)..hand.c.cpp) is required for parity.CONTRIBUTING.mdfile to ensure compliance with architectural guidelines.