add template get/convert for ghost

This commit is contained in:
ValKmjolnir
2024-06-13 23:47:58 +08:00
parent 9752b8823e
commit ce204352c6
13 changed files with 76 additions and 38 deletions

View File

@@ -0,0 +1,11 @@
use std.unix;
var count = 0;
while(1) {
unix.sleep(0.1);
count += 0.1;
println("process running time: ", count);
if (count > 2) {
die("test failed");
}
}

13
test/subprocess_test.nas Normal file
View File

@@ -0,0 +1,13 @@
use std.subprocess;
use std.unix;
var process = subprocess.create([
"./nasal",
"test/for_subprocess_test/infinite_loop.nas"
]);
unix.sleep(1);
println("kill subprocess...");
var res = subprocess.terminate(process);
println("subprocess killed, code ", res);