diff --git a/boa_tester/src/main.rs b/boa_tester/src/main.rs index 7bf1026e58b..b009bb28e56 100644 --- a/boa_tester/src/main.rs +++ b/boa_tester/src/main.rs @@ -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, /// 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)] @@ -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(), @@ -250,7 +250,7 @@ fn clone_test262() { return; } - println!("cloning test262"); + println!("Cloning test262"); let result = Command::new("git") .arg("clone") .arg(TEST262_REPOSITORY) @@ -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, @@ -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();