fix(reference): recognize CMake build manifests (#665)

This commit is contained in:
Kaoru0822
2026-10-06 16:17:50 +08:00
committed by GitHub
parent 217e8cf59f
commit 1a24be574d
3 changed files with 73 additions and 1 deletions
@@ -136,6 +136,41 @@ describe("reference source symlink import", () => {
});
});
describe("reference source manifest inventory", () => {
it("retains CMake build manifests in the imported inventory", async () => {
const root = await createTestTempDirectory("rea-reference-cmake-");
await mkdir(join(root, "src"));
await Promise.all([
writeFile(join(root, "CMakeLists.txt"), "project(example)\n"),
writeFile(
join(root, "src", "CMakeLists.txt"),
"add_library(example main.cpp)\n",
),
writeFile(join(root, "notes.txt"), "Build notes.\n"),
]);
const result = await importTree(root);
expect(result.ok).toBe(true);
if (!result.ok) return;
expect(result.value.manifests).toEqual([
"CMakeLists.txt",
"src/CMakeLists.txt",
]);
expect(result.value.entries).toContainEqual(
expect.objectContaining({
path: "CMakeLists.txt",
classifications: ["documentation", "manifest"],
}),
);
expect(result.value.entries).toContainEqual(
expect.objectContaining({
path: "src/CMakeLists.txt",
classifications: ["documentation", "manifest", "source"],
}),
);
});
});
describe("reference source import behavior", () => {
// The importer declares no byte ceiling and no entry-count ceiling. Scale
// independence cannot be asserted as a relationship over a bounded fixture,