Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into nan_box
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Dec 30, 2024
2 parents ac171fe + 77893f3 commit 8789d55
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 50 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ pollster = "0.4.0"
regex = "1.11.1"
regress = { version = "0.10.1", features = ["utf16"] }
rustc-hash = { version = "2.1.0", default-features = false }
serde_json = "1.0.133"
serde = "1.0.216"
serde_json = "1.0.134"
serde = "1.0.217"
static_assertions = "1.1.0"
textwrap = "0.16.0"
thin-vec = "0.2.13"
Expand All @@ -90,8 +90,8 @@ futures-util = "0.3.31"
isahc = "1.7.2"
rustyline = { version = "15.0.0", default-features = false }
dhat = "0.3.3"
quote = "1.0.37"
syn = { version = "2.0.90", default-features = false }
quote = "1.0.38"
syn = { version = "2.0.93", default-features = false }
proc-macro2 = "1.0"
synstructure = "0.13"
measureme = "12.0.0"
Expand All @@ -101,12 +101,12 @@ rand = "0.8.5"
num-integer = "0.1.46"
ryu-js = "1.0.1"
tap = "1.0.1"
thiserror = { version = "2.0.7", default-features = false }
thiserror = { version = "2.0.9", default-features = false }
dashmap = "6.1.0"
num_enum = "0.7.3"
itertools = { version = "0.13.0", default-features = false }
portable-atomic = "1.10.0"
bytemuck = { version = "1.19.0", default-features = false }
bytemuck = { version = "1.21.0", default-features = false }
arrayvec = "0.7.6"
intrusive-collections = "0.9.7"
cfg-if = "1.0.0"
Expand Down
7 changes: 5 additions & 2 deletions test262_config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
commit = "dad2774b2eab2119cc8390ae65db4a5016de2dfe"
commit = "8296db887368bbffa3379f995a1e628ddbe8421f"

[ignored]
# Not implemented yet:
Expand Down Expand Up @@ -35,6 +35,9 @@ features = [
# https://tc39.es/proposal-defer-import-eval
"import-defer",

# https://github.com/tc39/proposal-iterator-sequencing
"iterator-sequencing",

# https://github.com/tc39/proposal-json-modules
"json-modules",

Expand Down Expand Up @@ -75,4 +78,4 @@ features = [
"caller",
]

tests = []
tests = ["sm"]
4 changes: 4 additions & 0 deletions tests/tester/src/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ static FEATURE_EDITION: phf::Map<&'static str, SpecEdition> = phf::phf_map! {
// https://github.com/tc39/proposal-import-assertions/
"import-assertions" => SpecEdition::ESNext,

// Iterator sequencing
// https://github.com/tc39/proposal-iterator-sequencing
"iterator-sequencing" => SpecEdition::ESNext,

// JSON modules
// https://github.com/tc39/proposal-json-modules
"json-modules" => SpecEdition::ESNext,
Expand Down
64 changes: 38 additions & 26 deletions tests/tester/src/read.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Module to read the list of test suites from disk.
use std::{
collections::HashMap,
ffi::OsStr,
fs,
path::{Path, PathBuf},
Expand All @@ -10,7 +11,7 @@ use color_eyre::{
eyre::{OptionExt, WrapErr},
Result,
};
use rustc_hash::FxHashMap;
use rustc_hash::{FxBuildHasher, FxHashMap};
use serde::Deserialize;

use crate::{HarnessFile, Ignored};
Expand Down Expand Up @@ -92,33 +93,10 @@ pub(super) enum TestFlag {

/// Reads the Test262 defined bindings.
pub(super) fn read_harness(test262_path: &Path) -> Result<Harness> {
fn read_harness_file(path: PathBuf) -> Result<HarnessFile> {
let content = fs::read_to_string(path.as_path())
.wrap_err_with(|| format!("error reading the harness file `{}`", path.display()))?;

Ok(HarnessFile {
content: content.into_boxed_str(),
path: path.into_boxed_path(),
})
}
let mut includes = FxHashMap::default();

for entry in fs::read_dir(test262_path.join("harness"))
.wrap_err("error reading the harness directory")?
{
let entry = entry?;
let file_name = entry.file_name();
let file_name = file_name.to_string_lossy();
let mut includes: HashMap<Box<str>, HarnessFile, FxBuildHasher> = FxHashMap::default();

if file_name == "assert.js" || file_name == "sta.js" || file_name == "doneprintHandle.js" {
continue;
}
read_harness_dir(&test262_path.join("harness"), &mut includes)?;

includes.insert(
file_name.into_owned().into_boxed_str(),
read_harness_file(entry.path())?,
);
}
let assert = read_harness_file(test262_path.join("harness/assert.js"))?;
let sta = read_harness_file(test262_path.join("harness/sta.js"))?;
let doneprint_handle = read_harness_file(test262_path.join("harness/doneprintHandle.js"))?;
Expand All @@ -131,6 +109,40 @@ pub(super) fn read_harness(test262_path: &Path) -> Result<Harness> {
})
}

fn read_harness_dir(
directory_name: &Path,
includes: &mut HashMap<Box<str>, HarnessFile, FxBuildHasher>,
) -> Result<()> {
for entry in fs::read_dir(directory_name).wrap_err("error reading the harness directory")? {
let entry = entry?;
let file_name = entry.file_name();
let file_name = file_name.to_string_lossy().into_owned();

if directory_name.join(file_name.clone()).is_dir() {
read_harness_dir(&directory_name.join(file_name), includes)?;
continue;
}

if file_name == "assert.js" || file_name == "sta.js" || file_name == "doneprintHandle.js" {
continue;
}

includes.insert(file_name.into_boxed_str(), read_harness_file(entry.path())?);
}

Ok(())
}

fn read_harness_file(path: PathBuf) -> Result<HarnessFile> {
let content = fs::read_to_string(path.as_path())
.wrap_err_with(|| format!("error reading the harness file `{}`", path.display()))?;

Ok(HarnessFile {
content: content.into_boxed_str(),
path: path.into_boxed_path(),
})
}

/// Reads a test suite in the given path.
pub(super) fn read_suite(
path: &Path,
Expand Down

0 comments on commit 8789d55

Please sign in to comment.