Skip to content

Commit 0b283ac

Browse files
committed
test(manifest): the runtime sweep must not warn on what mcpp pack emits
`[[runtime.artifacts]]` and `[[runtime.requirements]]` are arrays rather than tables, so they reach the unknown-key sweep instead of being skipped with the `[runtime.<capability>]` provider channel. They are what `mcpp pack` writes into every packed library, so a false positive there would warn on all of them. Measured as zero before this was added; the assertion is what keeps it zero.
1 parent 620f9c1 commit 0b283ac

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/unit/test_manifest.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5126,6 +5126,14 @@ runtime_search_dirs = ["lib"]
51265126
deploy_files = ["a.txt"]
51275127
[runtime.somecapability]
51285128
provider = "pkg"
5129+
[[runtime.artifacts]]
5130+
role = "interface"
5131+
path = "include"
5132+
provenance = "source"
5133+
[[runtime.requirements]]
5134+
kind = "capability"
5135+
value = "display.present"
5136+
phase = "run"
51295137
[target.linux.runtime]
51305138
libraries = ["dl"]
51315139
link_library_dirs = ["lib"]
@@ -5137,6 +5145,12 @@ link_library_dirs = ["lib"]
51375145
EXPECT_TRUE(m->schemaWarnings.empty()) << all;
51385146
// A `[runtime.<capability>]` sub-table is a provider override, not a typo.
51395147
EXPECT_EQ(m->runtimeConfig.providerOverrides.at("somecapability"), "pkg");
5148+
// `[[runtime.artifacts]]` and `[[runtime.requirements]]` are arrays, not
5149+
// tables, so they reach the sweep rather than being skipped with the
5150+
// provider channel. They are exactly what `mcpp pack` emits into every
5151+
// packed library, so a false positive here would warn on all of them.
5152+
EXPECT_EQ(m->runtimeConfig.artifacts.size(), 1u);
5153+
EXPECT_EQ(m->runtimeConfig.requirements.size(), 1u);
51405154
}
51415155

51425156
// A manifest authored on Windows commonly begins with a UTF-8 byte-order mark.

0 commit comments

Comments
 (0)