Skip to content

Commit

Permalink
std tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
lordshashank committed Jul 6, 2024
1 parent 98ed962 commit cec2f39
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions build_system/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ where
println!("Keeping all {} tests", test_type);
}

if test_type == "ui" {
if test_type == "tests/ui" {
if run_error_pattern_test {
// After we removed the error tests that are known to panic with rustc_codegen_gcc, we now remove the passing tests since this runs the error tests.
walk_dir(
Expand Down Expand Up @@ -1003,7 +1003,7 @@ where
}

// FIXME: create a function "display_if_not_quiet" or something along the line.
println!("[TEST] rustc {} test suite", test_type);
println!("[TEST] rustc {} suite", test_type);
env.insert("COMPILETEST_FORCE_STAGE0".to_string(), "1".to_string());

let extra =
Expand All @@ -1027,7 +1027,7 @@ where
&"always",
&"--stage",
&"0",
&format!("tests/{}", test_type),
&test_type,
&"--rustc-args",
&rustc_args,
],
Expand All @@ -1039,7 +1039,7 @@ where

fn test_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
//test_rustc_inner(env, args, |_| Ok(false), false, "run-make")?;
test_rustc_inner(env, args, |_| Ok(false), false, "ui")
test_rustc_inner(env, args, |_| Ok(false), false, "tests/ui")
}

fn test_failing_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
Expand All @@ -1055,21 +1055,22 @@ fn test_failing_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
let result2 = test_rustc_inner(
env,
args,
retain_files_callback("tests/failing-ui-tests.txt", "ui"),
retain_files_callback("tests/failing-ui-tests.txt", "tests/ui"),
false,
"ui",
"tests/ui",
);

result1.and(result2)
}

fn test_successful_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
// All std tests are successful thus no need to prepare file callback
test_rustc_inner(env, args, |_| Ok(false), false, "library/std")?;
test_rustc_inner(
env,
args,
remove_files_callback("tests/failing-ui-tests.txt", "ui"),
remove_files_callback("tests/failing-ui-tests.txt", "tests/ui"),
false,
"ui",
"tests/ui",
)?;
Ok(())
/*test_rustc_inner(
Expand All @@ -1085,9 +1086,9 @@ fn test_failing_ui_pattern_tests(env: &Env, args: &TestArg) -> Result<(), String
test_rustc_inner(
env,
args,
remove_files_callback("tests/failing-ice-tests.txt", "ui"),
remove_files_callback("tests/failing-ice-tests.txt", "tests/ui"),
true,
"ui",
"tests/ui",
)
}

Expand All @@ -1105,7 +1106,7 @@ fn retain_files_callback<'a>(
run_command(
&[
&"find",
&format!("tests/{}", test_type),
&test_type,
&"-mindepth",
&"1",
&"-type",
Expand All @@ -1124,7 +1125,7 @@ fn retain_files_callback<'a>(
run_command(
&[
&"find",
&format!("tests/{}", test_type),
&test_type,
&"-type",
&"f",
&"-name",
Expand Down

0 comments on commit cec2f39

Please sign in to comment.