You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// * `env`: An environment variable that provides context for the function.
866
+
// * `args`: The arguments passed to the test. This could include things like the flags, config etc.
867
+
// * `prepare_files_callback`: A callback function that prepares the files needed for the test. Its used to remove/retain tests giving Error to run various rust test suits.
868
+
// * `run_error_pattern_test`: A boolean that determines whether to run only error pattern tests.
869
+
// * `test_type`: A string that indicates the type of the test being run.
870
+
//
859
871
fntest_rustc_inner<F>(
860
872
env:&Env,
861
873
args:&TestArg,
862
874
prepare_files_callback:F,
875
+
run_error_pattern_test:bool,
863
876
test_type:&str,
864
877
) -> Result<(),String>
865
878
where
@@ -876,54 +889,71 @@ where
876
889
}
877
890
878
891
if test_type == "ui"{
879
-
walk_dir(
880
-
rust_path.join("tests/ui"),
881
-
|dir| {
882
-
let dir_name = dir.file_name().and_then(|name| name.to_str()).unwrap_or("");
883
-
if[
884
-
"abi",
885
-
"extern",
886
-
"unsized-locals",
887
-
"proc-macro",
888
-
"threads-sendsync",
889
-
"borrowck",
890
-
"test-attrs",
891
-
]
892
-
.iter()
893
-
.any(|name| *name == dir_name)
894
-
{
895
-
std::fs::remove_dir_all(dir).map_err(|error| {
896
-
format!("Failed to remove folder `{}`: {:?}", dir.display(), error)
897
-
})?;
892
+
if run_error_pattern_test {
893
+
// 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.
894
+
walk_dir(
895
+
rust_path.join("tests/ui"),
896
+
&mut |_dir| Ok(()),
897
+
&mut |file_path| {
898
+
ifcontains_ui_error_patterns(file_path)? {
899
+
Ok(())
900
+
}else{
901
+
remove_file(file_path).map_err(|e| e.to_string())
902
+
}
903
+
},
904
+
true,
905
+
)?;
906
+
}else{
907
+
walk_dir(
908
+
rust_path.join("tests/ui"),
909
+
&mut |dir| {
910
+
let dir_name = dir.file_name().and_then(|name| name.to_str()).unwrap_or("");
911
+
if[
912
+
"abi",
913
+
"extern",
914
+
"unsized-locals",
915
+
"proc-macro",
916
+
"threads-sendsync",
917
+
"borrowck",
918
+
"test-attrs",
919
+
]
920
+
.iter()
921
+
.any(|name| *name == dir_name)
922
+
{
923
+
std::fs::remove_dir_all(dir).map_err(|error| {
924
+
format!("Failed to remove folder `{}`: {:?}", dir.display(), error)
925
+
})?;
926
+
}
927
+
Ok(())
928
+
},
929
+
&mut |_| Ok(()),
930
+
false,
931
+
)?;
932
+
933
+
// These two functions are used to remove files that are known to not be working currently
934
+
// with the GCC backend to reduce noise.
935
+
fndir_handling(dir:&Path) -> Result<(),String>{
936
+
if dir.file_name().map(|name| name == "auxiliary").unwrap_or(true){
937
+
returnOk(());
898
938
}
899
-
Ok(())
900
-
},
901
-
|_| Ok(()),
902
-
)?;
903
939
904
-
// These two functions are used to remove files that are known to not be working currently
905
-
// with the GCC backend to reduce noise.
906
-
fndir_handling(dir:&Path) -> Result<(),String>{
907
-
if dir.file_name().map(|name| name == "auxiliary").unwrap_or(true){
0 commit comments