diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37d2bc1c201..8e747455ca1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: # "--asm-tests", "--test-libcore", "--extended-rand-tests", - "--extended-regex-example-tests", "--extended-regex-tests", "--test-successful-rustc --nb-parts 2 --current-part 0", "--test-successful-rustc --nb-parts 2 --current-part 1", diff --git a/.github/workflows/m68k.yml b/.github/workflows/m68k.yml index a8c6b614ce8..b476bd1db6f 100644 --- a/.github/workflows/m68k.yml +++ b/.github/workflows/m68k.yml @@ -28,7 +28,6 @@ jobs: # TODO(antoyo): fix those on m68k. #"--test-libcore", #"--extended-rand-tests", - #"--extended-regex-example-tests", #"--extended-regex-tests", #"--test-successful-rustc --nb-parts 2 --current-part 0", #"--test-successful-rustc --nb-parts 2 --current-part 1", diff --git a/build_system/src/test.rs b/build_system/src/test.rs index d7f7a0eb47e..f1ab0fa3d4b 100644 --- a/build_system/src/test.rs +++ b/build_system/src/test.rs @@ -48,13 +48,6 @@ fn get_runners() -> Runners { "--extended-rand-tests", ("Run extended rand tests", extended_rand_tests), ); - runners.insert( - "--extended-regex-example-tests", - ( - "Run extended regex example tests", - extended_regex_example_tests, - ), - ); runners.insert( "--extended-regex-tests", ("Run extended regex tests", extended_regex_tests), @@ -782,15 +775,13 @@ fn extended_rand_tests(env: &Env, args: &TestArg) -> Result<(), String> { Ok(()) } -fn extended_regex_example_tests(env: &Env, args: &TestArg) -> Result<(), String> { +fn extended_regex_tests(env: &Env, args: &TestArg) -> Result<(), String> { if !args.is_using_gcc_master_branch() { - println!("Not using GCC master branch. Skipping `extended_regex_example_tests`."); + println!("Not using GCC master branch. Skipping `extended_regex_tests`."); return Ok(()); } - let path = Path::new(crate::BUILD_DIR).join("regex"); - run_cargo_command(&[&"clean"], Some(&path), env, args)?; // FIXME: create a function "display_if_not_quiet" or something along the line. - println!("[TEST] rust-lang/regex example shootout-regex-dna"); + println!("[TEST] rust-lang/regex tests"); let mut env = env.clone(); // newer aho_corasick versions throw a deprecation warning let rustflags = format!( @@ -798,60 +789,25 @@ fn extended_regex_example_tests(env: &Env, args: &TestArg) -> Result<(), String> env.get("RUSTFLAGS").cloned().unwrap_or_default() ); env.insert("RUSTFLAGS".to_string(), rustflags); - // Make sure `[codegen mono items] start` doesn't poison the diff - run_cargo_command( - &[&"build", &"--example", &"shootout-regex-dna"], - Some(&path), - &env, - args, - )?; + let path = Path::new(crate::BUILD_DIR).join("regex"); - run_cargo_command_with_callback( - &[&"run", &"--example", &"shootout-regex-dna"], + run_cargo_command( + &[ + &"build", + &"-p", + &"regex", + &"-p", + &"regex-syntax", + &"--release", + &"--all-targets", + &"--", + &"-q", + ], Some(&path), &env, args, - |cargo_command, cwd, env| { - // FIXME: rewrite this with `child.stdin.write_all()` because - // `examples/regexdna-input.txt` is very small. - let mut command: Vec<&dyn AsRef<OsStr>> = vec![&"bash", &"-c"]; - let cargo_args = cargo_command - .iter() - .map(|s| s.as_ref().to_str().unwrap()) - .collect::<Vec<_>>(); - let bash_command = format!( - "cat examples/regexdna-input.txt | {} | grep -v 'Spawned thread' > res.txt", - cargo_args.join(" "), - ); - command.push(&bash_command); - run_command_with_output_and_env(&command, cwd, Some(env))?; - run_command_with_output_and_env( - &[&"diff", &"-u", &"res.txt", &"examples/regexdna-output.txt"], - cwd, - Some(env), - )?; - Ok(()) - }, )?; - Ok(()) -} - -fn extended_regex_tests(env: &Env, args: &TestArg) -> Result<(), String> { - if !args.is_using_gcc_master_branch() { - println!("Not using GCC master branch. Skipping `extended_regex_tests`."); - return Ok(()); - } - // FIXME: create a function "display_if_not_quiet" or something along the line. - println!("[TEST] rust-lang/regex tests"); - let mut env = env.clone(); - // newer aho_corasick versions throw a deprecation warning - let rustflags = format!( - "{} --cap-lints warn", - env.get("RUSTFLAGS").cloned().unwrap_or_default() - ); - env.insert("RUSTFLAGS".to_string(), rustflags); - let path = Path::new(crate::BUILD_DIR).join("regex"); run_cargo_command( &[ &"test", @@ -868,6 +824,24 @@ fn extended_regex_tests(env: &Env, args: &TestArg) -> Result<(), String> { &env, args, )?; + + // Don't run integration tests for regex-autonata. they take like 2min each without + // much extra coverage of simd usage. + run_cargo_command( + &[ + &"build", + &"-p", + &"regex-automata", + &"--release", + &"--lib", + &"--", + &"-q", + ], + Some(&path), + &env, + args, + )?; + Ok(()) } @@ -883,7 +857,6 @@ fn extended_sysroot_tests(env: &Env, args: &TestArg) -> Result<(), String> { // hyperfine --runs "${RUN_RUNS:-10}" ./raytracer_cg_llvm ./raytracer_cg_gcc // popd extended_rand_tests(env, args)?; - extended_regex_example_tests(env, args)?; extended_regex_tests(env, args)?; Ok(())