From ac998999be3e7047f1f140f263424b3b287f939f Mon Sep 17 00:00:00 2001 From: Iban Eguia Date: Sun, 30 May 2021 19:47:43 +0200 Subject: [PATCH] Don't consider panic fixes as "new failures" (#1294) * Don't consider panic fixes as "new failures" * Improved coding style * Fixed Test262 tester for the testing update * Ignore JSON module tests * Test262 uses _FIXTURE at any point of the file name --- boa_tester/src/read.rs | 20 +++++++++++++++----- boa_tester/src/results.rs | 8 +++----- test262 | 2 +- test_ignore.txt | 1 + 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/boa_tester/src/read.rs b/boa_tester/src/read.rs index 6c66333b05..a2f0e8ffcd 100644 --- a/boa_tester/src/read.rs +++ b/boa_tester/src/read.rs @@ -128,7 +128,7 @@ pub(super) fn read_suite(path: &Path) -> io::Result { if entry.file_type()?.is_dir() { suites.push(read_suite(entry.path().as_path())?); - } else if entry.file_name().to_string_lossy().ends_with("_FIXTURE.js") { + } else if entry.file_name().to_string_lossy().contains("_FIXTURE") { continue; } else if IGNORED.contains_file(&entry.file_name().to_string_lossy()) { let mut test = Test::default(); @@ -165,13 +165,13 @@ pub(super) fn read_test(path: &Path) -> io::Result { })?; let content = fs::read_to_string(path)?; - let metadata = read_metadata(&content)?; + let metadata = read_metadata(&content, path)?; Ok(Test::new(name, content, metadata)) } /// Reads the metadata from the input test code. -fn read_metadata(code: &str) -> io::Result { +fn read_metadata(code: &str, test: &Path) -> io::Result { use once_cell::sync::Lazy; use regex::Regex; @@ -183,9 +183,19 @@ fn read_metadata(code: &str) -> io::Result { let yaml = META_REGEX .captures(code) - .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, "no metadata found"))? + .ok_or_else(|| { + io::Error::new( + io::ErrorKind::InvalidData, + format!("no metadata found for test {}", test.display()), + ) + })? .get(1) - .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, "no metadata found"))? + .ok_or_else(|| { + io::Error::new( + io::ErrorKind::InvalidData, + format!("no metadata found for test {}", test.display()), + ) + })? .as_str() .replace('\r', "\n"); diff --git a/boa_tester/src/results.rs b/boa_tester/src/results.rs index 2505461154..7aa65f7dc5 100644 --- a/boa_tester/src/results.rs +++ b/boa_tester/src/results.rs @@ -428,15 +428,13 @@ fn compute_result_diff( .into_boxed_str(); match (base_test.result, new_test.result) { - (TestOutcomeResult::Passed, TestOutcomeResult::Passed) - | (TestOutcomeResult::Ignored, TestOutcomeResult::Ignored) - | (TestOutcomeResult::Failed, TestOutcomeResult::Failed) - | (TestOutcomeResult::Panic, TestOutcomeResult::Panic) => {} + (a, b) if a == b => {} (_, TestOutcomeResult::Passed) => final_diff.fixed.push(test_name), + (TestOutcomeResult::Panic, _) => final_diff.panic_fixes.push(test_name), (_, TestOutcomeResult::Failed) => final_diff.broken.push(test_name), (_, TestOutcomeResult::Panic) => final_diff.new_panics.push(test_name), - (TestOutcomeResult::Panic, _) => final_diff.panic_fixes.push(test_name), + _ => {} } } diff --git a/test262 b/test262 index d454b8389b..e793512b55 160000 --- a/test262 +++ b/test262 @@ -1 +1 @@ -Subproject commit d454b8389b07dae252c008adb64ae242b812c801 +Subproject commit e793512b55c199de6abc392d1be4de7325dae544 diff --git a/test_ignore.txt b/test_ignore.txt index a00f96a5e7..25b45c8e45 100644 --- a/test_ignore.txt +++ b/test_ignore.txt @@ -4,6 +4,7 @@ flag:async // Non-implemented features: feature:TypedArray +feature:json-modules //feature:generators //feature:async-iteration //feature:class