Browse Source

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
pull/1297/head
Iban Eguia 4 years ago committed by GitHub
parent
commit
ac998999be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      boa_tester/src/read.rs
  2. 8
      boa_tester/src/results.rs
  3. 2
      test262
  4. 1
      test_ignore.txt

20
boa_tester/src/read.rs

@ -128,7 +128,7 @@ pub(super) fn read_suite(path: &Path) -> io::Result<TestSuite> {
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<Test> {
})?;
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<MetaData> {
fn read_metadata(code: &str, test: &Path) -> io::Result<MetaData> {
use once_cell::sync::Lazy;
use regex::Regex;
@ -183,9 +183,19 @@ fn read_metadata(code: &str) -> io::Result<MetaData> {
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");

8
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),
_ => {}
}
}

2
test262

@ -1 +1 @@
Subproject commit d454b8389b07dae252c008adb64ae242b812c801
Subproject commit e793512b55c199de6abc392d1be4de7325dae544

1
test_ignore.txt

@ -4,6 +4,7 @@ flag:async
// Non-implemented features:
feature:TypedArray
feature:json-modules
//feature:generators
//feature:async-iteration
//feature:class

Loading…
Cancel
Save