test: test262 测试打印报错日志并降低输出频率

This commit is contained in:
爱特每羊队
2026-06-06 21:32:06 +08:00
parent 3b1d8e47c2
commit 48f6737077
2 changed files with 14 additions and 3 deletions
+1
View File
@@ -13,3 +13,4 @@ AGENTS.md
# Build Artifacts # Build Artifacts
target/ target/
test262-crash.log
+12 -2
View File
@@ -2,6 +2,7 @@ use oxide_compiler::compiler::Compiler;
use oxide_kernel::kernel::{KernelConfig, OxideKernel}; use oxide_kernel::kernel::{KernelConfig, OxideKernel};
use oxide_vm::vm::Vm; use oxide_vm::vm::Vm;
use serde::Deserialize; use serde::Deserialize;
use std::io::Write;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
@@ -155,6 +156,7 @@ fn is_skipped(meta: &TestMeta) -> Option<String> {
"regexp-dotall", "regexp-dotall",
"json-superset", "json-superset",
"for-of", "for-of",
"Temporal",
"cross-realm", "cross-realm",
"new.target", "new.target",
"well-formed-json-stringify", "well-formed-json-stringify",
@@ -162,7 +164,7 @@ fn is_skipped(meta: &TestMeta) -> Option<String> {
]; ];
for feat in &meta.features { for feat in &meta.features {
if excluded_features.contains(&feat.as_str()) { if excluded_features.contains(&feat.as_str()) || feat.starts_with("Intl") {
return Some(format!("excluded feature: {feat}")); return Some(format!("excluded feature: {feat}"));
} }
} }
@@ -341,7 +343,7 @@ fn main() {
let total = paths.len(); let total = paths.len();
for (i, path) in paths.iter().enumerate() { for (i, path) in paths.iter().enumerate() {
if i % 100 == 0 { if i % 500 == 0 {
eprintln!( eprintln!(
" progress: {}/{} ({}% pass={} fail={} skip={})", " progress: {}/{} ({}% pass={} fail={} skip={})",
i, i,
@@ -389,6 +391,14 @@ fn main() {
continue; continue;
} }
let rel = path.strip_prefix(&test262_root).unwrap_or(path);
if let Ok(mut f) = std::fs::File::create("test262-crash.log") {
let _ = write!(f, "{}\n", rel.display());
let _ = f.flush();
}
eprintln!(" running: {}", rel.display());
let _ = std::io::stderr().flush();
let result = run_test(path, &source, &meta, &kernel); let result = run_test(path, &source, &meta, &kernel);
match &result.outcome { match &result.outcome {
TestOutcome::Pass(_) => stats.pass += 1, TestOutcome::Pass(_) => stats.pass += 1,