fix: Fix test execution hanging issue
- Replace `os.execute()` with `os.system()` - Avoid hanging due to unclosed file descriptors - Update error message to include command exit code
This commit is contained in:
@@ -121,11 +121,11 @@ fn dotest(path string, base_dir string, mut cache TestCache) ! {
|
||||
|
||||
cmd := 'v -stats -enable-globals -n -w -gc none test ${norm_path}'
|
||||
println(cmd)
|
||||
result := os.execute(cmd)
|
||||
eprintln(result)
|
||||
if result.exit_code != 0 {
|
||||
eprintln('Test failed: ${path}')
|
||||
eprintln(result.output)
|
||||
|
||||
// Use system() instead of execute() to avoid hanging on unclosed file descriptors
|
||||
exit_code := os.system(cmd)
|
||||
if exit_code != 0 {
|
||||
eprintln('Test failed: ${path} (exit code: ${exit_code})')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user