test program

This commit is contained in:
2025-05-30 19:11:33 -05:00
parent b71c72db8b
commit fc09693c93

31
scripts/test.ce Normal file
View File

@@ -0,0 +1,31 @@
var io = use("io")
var test = args[0]
if (test) {
log.console(`gonna run ${test}`)
$_.stop()
}
var fs = io.enumerate("tests");
var tests = [];
var passed = 0;
var failed = 0;
var errors = [];
for (var i = 0; i < fs.length; i++) {
var file = fs[i];
if (file.endsWith(".ce") && file !== "spawnee.ce" && file !== "underling.ce" && file !== "unneeded.ce")
tests.push(file.name());
}
log.console("Running " + tests.length + " tests...\n");
for (var i = 0; i < tests.length; i++) {
var test = tests[i]
log.console("Running test: " + test)
var actor
$_.start(e => {
actor = e.actor
}, "tests/" + test);
}