IcyZip

tools/lab.mjs

All files · Open raw file

977 bytes · SHA-256: 49642cff502e208c148a2ff171d9ce8430123fc8619202ba43452b53a94045e5

// Copyright 2026 Richard Andresik. SPDX-License-Identifier: Apache-2.0
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import { inspect } from "./inspect.mjs";
import { fuzz } from "./fuzz.mjs";

process.chdir(fileURLToPath(new URL("../", import.meta.url)));
console.log(JSON.stringify(inspect()));
const tests = ["test/minimal.test.mjs", "test/crypto.test.mjs", "test/file-receive.test.mjs",
    "test/security-regressions.test.mjs", "test/provenance.test.mjs", "test/container.test.mjs"];
const result = spawnSync(process.execPath, ["--test", ...tests], { stdio: "inherit", timeout: 120000 });
if (result.error || result.status !== 0) {
    console.error(result.error?.message || "Test suite failed");
    process.exitCode = result.status || 1;
} else {
    console.log(JSON.stringify({ result: "fuzz-pass", ...await fuzz() }));
    console.log("Lab passed for the tested inputs. See THREAT-MODEL.md for scope and limitations.");
}