CMakeLists lists the 136 test-target fragments by hand: a new target needs a top-file edit (replace the includes with one glob)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cmake, cpp
- Domain
- build-system, testing
Research direction
Read src/runtime/CMakeLists.txt around the BUILD_TESTING block and tools/tests/test_runtime_lifecycle_invariants.py first. Move the loop and conditional wrappers into their test fragments, and relocate the top-level statements that name fragment targets before adding the sorted glob and include loop. Configure with just test-auth-unit <name> before and after; done means the target list and compile commands match, and the invariant test rejects a hand-listed include.
Written by the indexing model from the issue text.
Description
Evidence at 488513ca3
src/runtime/CMakeLists.txt lists each of the 136 test-target fragments in src/runtime/tests/targets/ by hand, one include(tests/targets/<name>.cmake) line each (grep -c '^include(tests/targets/' src/runtime/CMakeLists.txt prints 136; the lines run from 454 to 1004, inside the if(BUILD_TESTING) block that runs from 450 to 1011). A new test target therefore needs an edit to the top file as well as its own fragment. Four of the 136 are not plain includes:
- two sit inside
foreach(_logging_suffix a b)andforeach(_exports_fixture nevr deprecated)and take the loop variable through the fragment's name (test_plugin_logging_.cmake, test_plugin_.cmake); - one sits inside
if(NEVR_UPDATE_CORE_ENABLED)(test_update_core_link.cmake, line 959); - two sit inside a nested
ifin the block.
Top-level statements in the same block also name fragment targets: add_dependencies(test_behavioral test_plugin_future_api ...) (about line 994) runs between fragment includes.
Not shown
- Whether every fragment runs unchanged when all of them are included from one place. The loop and conditional includes need their wrapper moved into the fragment; the top-level statements that name fragment targets need to move into a fragment too. Neither is measured yet.
- The compile commands and the target list after the change. The change must keep both, which is measured by configuring before and after.
Falsifier
After the fix, adding a file tests/targets/.cmake changes no CMakeLists.txt: the target appears in the configured build (ninja -t targets all), and the top file's text does not change. At 488513ca3 the same addition needs an include line in the top file.
Work
- Test first, in tools/tests/test_runtime_lifecycle_invariants.py: the top file contains no
include(tests/targets/<name>.cmake)line and contains one glob over tests/targets/*.cmake. Red at 488513ca3 (136 hand-listed lines). - The top file gets
file(GLOB ... CONFIGURE_DEPENDS ...)over src/runtime/tests/targets/*.cmake, sorted, then a foreach that includes each file, at one position after the last top-level statement that names a fragment target. - Each loop and conditional include moves its wrapper into its fragment (the foreach or the if goes into the .cmake file).
- The top-level statements that name fragment targets move into a fragment.
- Verification: configure before and after (the target list has 945 entries before and after, and the compile commands are identical). The configure is
just test-auth-unit <name>with BUILD_TESTING on, which configures the tree. - Mutant: a hand-listed include line added back fails the rule test.
- Dominant language
- C++
- Stars
- 3
- Forks
- 5
- Avg merge
- 4h 37m
- Merged PRs (30d)
- 524
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EchoTools/nevr-runtime
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
EchoTools/nevr-runtime#2912 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
EchoTools/nevr-runtime#2910 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
EchoTools/nevr-runtime#2909 ·
Maintainers usually reply within 1 day
-
build: the generated defaults header is written 0600, so a seat outside nevr-build cannot read itOpenbacklog
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
EchoTools/nevr-runtime#2901 · 1 comment ·
Maintainers usually reply within 1 day
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EchoTools/nevr-runtime#2897 ·
Maintainers usually reply within 1 day
All issues in EchoTools/nevr-runtime
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
bug-unconfirmed
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
libc++
Difficulty 1/5 Under an hour Newbie friendliness 88/100
llvm/llvm-project#246508 ·
Maintainers usually reply within 1 day
-
good first issue help wanted phase:0 priority:P3 type:task
Difficulty 2/5 1-3 hours Newbie friendliness 67/100