fix: test262 添加执行步数上限

This commit is contained in:
2026-06-09 18:23:23 +08:00
parent a84b54683b
commit 7ae011fc56
+8 -1
View File
@@ -599,7 +599,14 @@ fn run_tests() -> bool {
let paths = discover_tests(&test262_root); let paths = discover_tests(&test262_root);
eprintln!("found {} test files", paths.len()); eprintln!("found {} test files", paths.len());
let kernel = Arc::new(OxideKernel::new(KernelConfig::minimal())); // Bound each test's execution so a single infinite-loop / unsupported-feature
// loop fails (or skips) instead of stalling the whole serial run. The VM already
// emits a "VM step limit exceeded" error on overrun, which the runner classifies
// as a step-limit result (skip by default, fail under --no-skip). Override only the
// runner's local config; KernelConfig::minimal() stays unbounded for other crates.
let mut kernel_config = KernelConfig::minimal();
kernel_config.max_steps = Some(50_000_000);
let kernel = Arc::new(OxideKernel::new(kernel_config));
init_kernel_builtins(&kernel); init_kernel_builtins(&kernel);
let harness_sources = HarnessSources::new(); let harness_sources = HarnessSources::new();
let mut harness_cache = HarnessPrefixCache::new(); let mut harness_cache = HarnessPrefixCache::new();