From 91527340a4ef71c7837443bc09c3c5fd783222d6 Mon Sep 17 00:00:00 2001 From: "Iban Eguia (Razican)" Date: Sat, 29 May 2021 20:42:54 +0200 Subject: [PATCH 1/5] Don't consider panic fixes as "new failures" --- boa_tester/src/results.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boa_tester/src/results.rs b/boa_tester/src/results.rs index 25054611540..3e7ae5560ee 100644 --- a/boa_tester/src/results.rs +++ b/boa_tester/src/results.rs @@ -433,10 +433,14 @@ fn compute_result_diff( | (TestOutcomeResult::Failed, TestOutcomeResult::Failed) | (TestOutcomeResult::Panic, TestOutcomeResult::Panic) => {} + (TestOutcomeResult::Panic, TestOutcomeResult::Failed) => { + final_diff.panic_fixes.push(test_name) + } + (_, TestOutcomeResult::Passed) => final_diff.fixed.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), + _ => {} } } From 26df210b700be41991b89eca6a2125cc053ec413 Mon Sep 17 00:00:00 2001 From: "Iban Eguia (Razican)" Date: Sat, 29 May 2021 20:55:08 +0200 Subject: [PATCH 2/5] Improved coding style --- boa_tester/src/results.rs | 10 ++-------- test262 | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/boa_tester/src/results.rs b/boa_tester/src/results.rs index 3e7ae5560ee..304505a038a 100644 --- a/boa_tester/src/results.rs +++ b/boa_tester/src/results.rs @@ -428,15 +428,9 @@ 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) => {} - - (TestOutcomeResult::Panic, TestOutcomeResult::Failed) => { - final_diff.panic_fixes.push(test_name) - } + (a, b) if a == b => {} + (TestOutcomeResult::Panic, _) => final_diff.panic_fixes.push(test_name), (_, TestOutcomeResult::Passed) => final_diff.fixed.push(test_name), (_, TestOutcomeResult::Failed) => final_diff.broken.push(test_name), (_, TestOutcomeResult::Panic) => final_diff.new_panics.push(test_name), diff --git a/test262 b/test262 index d454b8389b0..e793512b55c 160000 --- a/test262 +++ b/test262 @@ -1 +1 @@ -Subproject commit d454b8389b07dae252c008adb64ae242b812c801 +Subproject commit e793512b55c199de6abc392d1be4de7325dae544 From 2c59f331bfadcb03fd04510937b07bda936b2402 Mon Sep 17 00:00:00 2001 From: "Iban Eguia (Razican)" Date: Sun, 30 May 2021 10:29:57 +0200 Subject: [PATCH 3/5] Fixed Test262 tester for the testing update --- boa_tester/src/read.rs | 29 ++++++++++++++++++++++++----- boa_tester/src/results.rs | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/boa_tester/src/read.rs b/boa_tester/src/read.rs index 6c66333b057..14b070a0905 100644 --- a/boa_tester/src/read.rs +++ b/boa_tester/src/read.rs @@ -103,6 +103,15 @@ pub(super) fn read_harness(test262_path: &Path) -> io::Result { /// Reads a test suite in the given path. pub(super) fn read_suite(path: &Path) -> io::Result { + use once_cell::sync::Lazy; + use regex::Regex; + + /// Regular expression to retrieve the metadata of a test. + static FIXTURE_REGEX: Lazy = Lazy::new(|| { + Regex::new(r#".*_FIXTURE.js(on)?"#) + .expect("could not compile fixture retrieval regular expression") + }); + let name = path .file_name() .ok_or_else(|| { @@ -128,7 +137,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 FIXTURE_REGEX.is_match(&entry.file_name().to_string_lossy()) { continue; } else if IGNORED.contains_file(&entry.file_name().to_string_lossy()) { let mut test = Test::default(); @@ -165,13 +174,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 +192,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 304505a038a..7aa65f7dc5f 100644 --- a/boa_tester/src/results.rs +++ b/boa_tester/src/results.rs @@ -430,8 +430,8 @@ fn compute_result_diff( match (base_test.result, new_test.result) { (a, b) if a == b => {} - (TestOutcomeResult::Panic, _) => final_diff.panic_fixes.push(test_name), (_, 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), From c737bf8992036d771daf455ed68e7199b3dd43a9 Mon Sep 17 00:00:00 2001 From: "Iban Eguia (Razican)" Date: Sun, 30 May 2021 10:33:43 +0200 Subject: [PATCH 4/5] Ignore JSON module tests --- test_ignore.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test_ignore.txt b/test_ignore.txt index a00f96a5e7e..25b45c8e457 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 From ab6ce0c97889e58c9f2d1d4622261bf46be0238b Mon Sep 17 00:00:00 2001 From: "Iban Eguia (Razican)" Date: Sun, 30 May 2021 10:38:25 +0200 Subject: [PATCH 5/5] Test262 uses _FIXTURE at any point of the file name --- boa_tester/src/read.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/boa_tester/src/read.rs b/boa_tester/src/read.rs index 14b070a0905..a2f0e8ffcdc 100644 --- a/boa_tester/src/read.rs +++ b/boa_tester/src/read.rs @@ -103,15 +103,6 @@ pub(super) fn read_harness(test262_path: &Path) -> io::Result { /// Reads a test suite in the given path. pub(super) fn read_suite(path: &Path) -> io::Result { - use once_cell::sync::Lazy; - use regex::Regex; - - /// Regular expression to retrieve the metadata of a test. - static FIXTURE_REGEX: Lazy = Lazy::new(|| { - Regex::new(r#".*_FIXTURE.js(on)?"#) - .expect("could not compile fixture retrieval regular expression") - }); - let name = path .file_name() .ok_or_else(|| { @@ -137,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 FIXTURE_REGEX.is_match(&entry.file_name().to_string_lossy()) { + } 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();