singularity-forge/tests/live/run.ts
ace-pm b29c12d5e5 refactor(native): rename gsd_parser.rs to forge_parser.rs
Final rebrand: rename remaining Rust source file to complete the gsd → forge
transition. All parser references already use forge_parser after earlier commits.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:58:21 +02:00

52 lines
1.4 KiB
TypeScript

import { readdirSync } from "fs";
import { execFileSync } from "child_process";
import { join, dirname } from "path";
import { fileURLToPath } from "url";
const __dirname = dirname(fileURLToPath(import.meta.url));
if ((process.env.SF_LIVE_TESTS || process.env.GSD_LIVE_TESTS) !== "1") {
console.log("Skipping live tests (set SF_LIVE_TESTS=1 to enable)");
process.exit(0);
}
const testFiles = readdirSync(__dirname)
.filter((f) => f.startsWith("test-") && f.endsWith(".ts"))
.sort();
if (testFiles.length === 0) {
console.error("No live test files found");
process.exit(1);
}
let passed = 0;
let failed = 0;
let skipped = 0;
for (const file of testFiles) {
const filePath = join(__dirname, file);
const label = file.replace(/\.ts$/, "");
try {
execFileSync("node", ["--experimental-strip-types", filePath], {
encoding: "utf8",
stdio: "pipe",
timeout: 60_000,
});
console.log(` PASS ${label}`);
passed++;
} catch (err: any) {
const output = (err.stdout || "") + (err.stderr || "");
if (output.includes("SKIPPED")) {
console.log(` SKIP ${label}`);
skipped++;
} else {
console.error(` FAIL ${label}`);
if (err.stdout) console.error(err.stdout);
if (err.stderr) console.error(err.stderr);
failed++;
}
}
}
console.log(`\nLive tests: ${passed} passed, ${failed} failed, ${skipped} skipped`);
if (failed > 0) process.exit(1);