Remove simple-test-runner.js
Delete the simple test runner file that was replaced by test-current.js
This commit is contained in:
parent
0d6e499cc9
commit
09d1901bcb
1 changed files with 0 additions and 42 deletions
|
|
@ -1,42 +0,0 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
import fs from "node:fs/promises";
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
const testFiles = await fs.readdir("./tests");
|
|
||||||
const cFiles = testFiles.filter(file => file.endsWith(".c"));
|
|
||||||
|
|
||||||
let passed = 0;
|
|
||||||
let failed = 0;
|
|
||||||
|
|
||||||
console.log(`Running ${cFiles.length} tests...\n`);
|
|
||||||
|
|
||||||
for (const cFile of cFiles) {
|
|
||||||
try {
|
|
||||||
console.log(`Testing ${cFile}...`);
|
|
||||||
const { spawn } = await import("node:child_process");
|
|
||||||
const child = spawn("node", ["index.js", `tests/${cFile}`], { cwd: "." });
|
|
||||||
|
|
||||||
child.on("close", (code) => {
|
|
||||||
if (code === 0) {
|
|
||||||
console.log(` ✓ ${cFile} passed`);
|
|
||||||
passed++;
|
|
||||||
} else {
|
|
||||||
console.log(` ✗ ${cFile} failed with code ${code}`);
|
|
||||||
failed++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
child.stderr.on("data", (data) => {
|
|
||||||
console.error(` Error: ${data.toString()}`);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.log(` ✗ ${cFile} failed with exception: ${error.message}`);
|
|
||||||
failed++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`\nResults: ${passed} passed, ${failed} failed`);
|
|
||||||
}
|
|
||||||
|
|
||||||
main().catch(console.error);
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue