Skip to content

Add checks for duplicated section names - #94

Merged
ryanmrichard merged 2 commits into
masterfrom
89-add-checks-to-ensure-test-and-section-names-do-not-clobber-already-defined-units
Dec 4, 2023
Merged

Add checks for duplicated section names#94
ryanmrichard merged 2 commits into
masterfrom
89-add-checks-to-ensure-test-and-section-names-do-not-clobber-already-defined-units

Conversation

@AutonomicPerfectionist

Copy link
Copy Markdown
Contributor

Is this pull request associated with an issue(s)?
Fixes #89
Also fixes a previously-unknown bug where subsections of an EXPECTFAIL section would not run due to not having their section names being set in the expectfail template.

Description
This PR adds some safety checks to ensure that sections do not have the same name in the same scope. It has caught two such instances of duplicated names in CMakePP, which I will be fixing in a different PR. I don't think duplicated names would cause internal issues after #91 for regular sections, but EXPECTFAIL could encounter some issues due to relying on section names for whether or not to execute them. The EXPECTFAIL system should be changed to not rely on the names, but for now, it's fine.

While writing the test to verify the behavior of this new check, I discovered that EXPECTFAIL sections would not run subsections, since their IDs are not set in the expectfail template (are not discovered until running in the subprocess). This PR fixes the issue by adding a new global that is set in the template specifying the target section that the subprocess is supposed to run. Any sections that have the target as a parent, either directly or indirectly, will be enabled and ran as normal.

@ryanmrichard
ryanmrichard merged commit 80fcb90 into master Dec 4, 2023
@ryanmrichard
ryanmrichard deleted the 89-add-checks-to-ensure-test-and-section-names-do-not-clobber-already-defined-units branch December 4, 2023 14:47
@github-actions

github-actions Bot commented Dec 4, 2023

Copy link
Copy Markdown

🚀 [bumpr] Bumped! New version:v0.1.12 Changes:v0.1.11...v0.1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants