Skip to content

Commit

Permalink
Clone test262 lazily
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Aug 14, 2023
1 parent 6bb2721 commit 9de0f72
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions boa_tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ enum Cli {
verbose: u8,

/// Path to the Test262 suite.
#[arg(long, default_value = "./test262", value_hint = ValueHint::DirPath)]
test262_path: PathBuf,
#[arg(long, value_hint = ValueHint::DirPath)]
test262_path: Option<PathBuf>,

/// Which specific test or test suite to run. Should be a path relative to the Test262 directory: e.g. "test/language/types/number"
#[arg(short, long, default_value = "test", value_hint = ValueHint::AnyPath)]
Expand Down Expand Up @@ -221,7 +221,7 @@ fn main() -> Result<()> {
} => run_test_suite(
verbose,
!disable_parallelism,
test262_path.as_path(),
test262_path.as_deref(),
suite.as_path(),
output.as_deref(),
ignore.as_path(),
Expand Down Expand Up @@ -250,7 +250,7 @@ fn clone_test262() {
return;
}

println!("cloning test262");
println!("Cloning test262");
let result = Command::new("git")
.arg("clone")
.arg(TEST262_REPOSITORY)
Expand Down Expand Up @@ -279,7 +279,7 @@ fn clone_test262() {
fn run_test_suite(
verbose: u8,
parallel: bool,
test262: &Path,
test262: Option<&Path>,
suite: &Path,
output: Option<&Path>,
ignore: &Path,
Expand All @@ -297,7 +297,11 @@ fn run_test_suite(
}
}

clone_test262();
let test262 = test262.unwrap_or_else(|| {
clone_test262();

Path::new("./test262")
});

let ignored = {
let mut input = String::new();
Expand Down

0 comments on commit 9de0f72

Please sign in to comment.