test: overhaul deterministic suite architecture

This commit is contained in:
morluto
2026-07-29 22:00:38 +00:00
parent 7f2348619a
commit 513d9b1555
371 changed files with 30879 additions and 24389 deletions
@@ -0,0 +1,37 @@
import { rm, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { createTestTempDirectory } from "../../../fixtures/temporaryDirectory.js";
import { buildManagedPeFixture } from "../../../../scripts/lib/managed-pe-fixture.mjs";
import { parseBinaryTarget } from "../../../../src/domain/binaryTarget.js";
const workspaces: string[] = [];
afterEach(async () => {
await Promise.all(
workspaces.splice(0).map((path) => rm(path, { recursive: true })),
);
});
describe("managed conformance fixture", () => {
it("emits PE32+ headers when the COFF machine is x86-64", async () => {
const workspace = await createTestTempDirectory("rea-managed-fixture-");
workspaces.push(workspace);
const path = join(workspace, "fixture.exe");
await writeFile(path, buildManagedPeFixture({ machine: 0x8664 }));
const parsed = await parseBinaryTarget(path);
expect(parsed).toMatchObject({
ok: true,
value: {
format: "pe",
architecture: "x86_64",
managed: true,
},
});
});
});