@@ -840,6 +840,7 @@ fn should_remove_test(file_path: &Path) -> Result<bool, String> {
840
840
"-Cllvm-args" ,
841
841
"//~" ,
842
842
"thread" ,
843
+ "//@ known-bug"
843
844
]
844
845
. iter ( )
845
846
. any ( |check| line. contains ( check) )
@@ -865,11 +866,13 @@ fn test_rustc_inner<F>(
865
866
where
866
867
F : Fn ( & Path ) -> Result < bool , String > ,
867
868
{
869
+ // FIXME: create a function "display_if_not_quiet" or something along the line.
868
870
println ! ( "[TEST] rust-lang/rust" ) ;
869
871
let mut env = env. clone ( ) ;
870
872
let rust_path = setup_rustc ( & mut env, args) ?;
871
873
872
874
if !prepare_files_callback ( & rust_path) ? {
875
+ // FIXME: create a function "display_if_not_quiet" or something along the line.
873
876
println ! ( "Keeping all {} tests" , test_type) ;
874
877
}
875
878
@@ -899,6 +902,8 @@ where
899
902
|_| Ok ( ( ) ) ,
900
903
) ?;
901
904
905
+ // These two functions are used to remove files that are known to not be working currently
906
+ // with the GCC backend to reduce noise.
902
907
fn dir_handling ( dir : & Path ) -> Result < ( ) , String > {
903
908
if dir. file_name ( ) . map ( |name| name == "auxiliary" ) . unwrap_or ( true ) {
904
909
return Ok ( ( ) ) ;
@@ -918,16 +923,6 @@ where
918
923
Ok ( ( ) )
919
924
}
920
925
921
- remove_file ( & rust_path. join ( "tests/ui/consts/const_cmp_type_id.rs" ) ) ?;
922
- remove_file ( & rust_path. join ( "tests/ui/consts/issue-73976-monomorphic.rs" ) ) ?;
923
- // this test is oom-killed in the CI.
924
- remove_file ( & rust_path. join ( "tests/ui/consts/issue-miri-1910.rs" ) ) ?;
925
- // Tests generating errors.
926
- remove_file ( & rust_path. join ( "tests/ui/consts/issue-94675.rs" ) ) ?;
927
- remove_file ( & rust_path. join ( "tests/ui/mir/mir_heavy_promoted.rs" ) ) ?;
928
- remove_file ( & rust_path. join ( "tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs" ) ) ?;
929
- remove_file ( & rust_path. join ( "tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs" ) ) ?;
930
-
931
926
walk_dir ( rust_path. join ( "tests/ui" ) , dir_handling, file_handling) ?;
932
927
933
928
let nb_parts = args. nb_parts . unwrap_or ( 0 ) ;
@@ -960,7 +955,10 @@ where
960
955
. map ( |line| line. trim ( ) )
961
956
. filter ( |line| !line. is_empty ( ) )
962
957
. collect :: < Vec < _ > > ( ) ;
958
+ // To ensure it'll be always the same sub files, we sort the content.
963
959
files. sort ( ) ;
960
+ // We increment the number of tests by one because if this is an odd number, we would skip
961
+ // one test.
964
962
let count = files. len ( ) / nb_parts + 1 ;
965
963
let start = current_part * count;
966
964
for path in files. iter ( ) . skip ( start) . take ( count) {
@@ -969,18 +967,19 @@ where
969
967
}
970
968
}
971
969
970
+ // FIXME: create a function "display_if_not_quiet" or something along the line.
972
971
println ! ( "[TEST] rustc {} test suite" , test_type) ;
973
972
env. insert ( "COMPILETEST_FORCE_STAGE0" . to_string ( ) , "1" . to_string ( ) ) ;
974
973
975
974
let extra =
976
975
if args. is_using_gcc_master_branch ( ) { "" } else { " -Csymbol-mangling-version=v0" } ;
977
976
978
977
let rustc_args = format ! (
979
- "{} -Zcodegen-backend={} --sysroot {}{ }" ,
980
- env. get( "TEST_FLAGS" ) . unwrap_or( & String :: new( ) ) ,
981
- args. config_info. cg_backend_path,
982
- args. config_info. sysroot_path,
983
- extra,
978
+ "{test_flags } -Zcodegen-backend={backend } --sysroot {sysroot}{extra }" ,
979
+ test_flags = env. get( "TEST_FLAGS" ) . unwrap_or( & String :: new( ) ) ,
980
+ backend = args. config_info. cg_backend_path,
981
+ sysroot = args. config_info. sysroot_path,
982
+ extra = extra ,
984
983
) ;
985
984
986
985
env. get_mut ( "RUSTFLAGS" ) . unwrap ( ) . clear ( ) ;
@@ -1009,18 +1008,21 @@ fn test_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
1009
1008
}
1010
1009
1011
1010
fn test_failing_rustc ( env : & Env , args : & TestArg ) -> Result < ( ) , String > {
1012
- test_rustc_inner (
1011
+ let result1 = test_rustc_inner (
1013
1012
env,
1014
1013
args,
1015
1014
prepare_files_callback_failing ( "tests/failing-run-make-tests.txt" , "run-make" ) ,
1016
1015
"run-make" ,
1017
- ) ?;
1018
- test_rustc_inner (
1016
+ ) ;
1017
+
1018
+ let result2 = test_rustc_inner (
1019
1019
env,
1020
1020
args,
1021
1021
prepare_files_callback_failing ( "tests/failing-ui-tests.txt" , "ui" ) ,
1022
1022
"ui" ,
1023
- )
1023
+ ) ;
1024
+
1025
+ result1. and ( result2)
1024
1026
}
1025
1027
1026
1028
fn test_successful_rustc ( env : & Env , args : & TestArg ) -> Result < ( ) , String > {
@@ -1045,6 +1047,7 @@ fn prepare_files_callback_failing<'a>(
1045
1047
move |rust_path| {
1046
1048
let files = std:: fs:: read_to_string ( file_path) . unwrap_or_default ( ) ;
1047
1049
let first_file_name = files. lines ( ) . next ( ) . unwrap_or ( "" ) ;
1050
+ // If the first line ends with a `/`, we treat it as a directory.
1048
1051
if first_file_name. ends_with ( '/' ) {
1049
1052
// Treat as directory
1050
1053
// Removing all tests.
@@ -1064,20 +1067,6 @@ fn prepare_files_callback_failing<'a>(
1064
1067
] ,
1065
1068
Some ( rust_path) ,
1066
1069
) ?;
1067
- // Putting back only the failing ones.
1068
-
1069
- if let Ok ( files) = std:: fs:: read_to_string ( & file_path) {
1070
- for file in
1071
- files. split ( '\n' ) . map ( |line| line. trim ( ) ) . filter ( |line| !line. is_empty ( ) )
1072
- {
1073
- run_command ( & [ & "git" , & "checkout" , & "--" , & file] , Some ( & rust_path) ) ?;
1074
- }
1075
- } else {
1076
- println ! (
1077
- "Failed to read `{}`, not putting back failing {} tests" ,
1078
- file_path, test_type
1079
- ) ;
1080
- }
1081
1070
} else {
1082
1071
// Treat as file
1083
1072
// Removing all tests.
@@ -1096,20 +1085,20 @@ fn prepare_files_callback_failing<'a>(
1096
1085
] ,
1097
1086
Some ( rust_path) ,
1098
1087
) ?;
1099
- // Putting back only the failing ones.
1100
- if let Ok ( files) = std:: fs:: read_to_string ( & file_path) {
1101
- for file in
1102
- files. split ( '\n' ) . map ( |line| line. trim ( ) ) . filter ( |line| !line. is_empty ( ) )
1103
- {
1104
- run_command ( & [ & "git" , & "checkout" , & "--" , & file] , Some ( & rust_path) ) ?;
1105
- }
1106
- } else {
1107
- println ! (
1108
- "Failed to read `{}`, not putting back failing `{}` tests" ,
1109
- file_path, test_type
1110
- ) ;
1088
+ }
1089
+
1090
+ // Putting back only the failing ones.
1091
+ if let Ok ( files) = std:: fs:: read_to_string ( & file_path) {
1092
+ for file in files. split ( '\n' ) . map ( |line| line. trim ( ) ) . filter ( |line| !line. is_empty ( ) ) {
1093
+ run_command ( & [ & "git" , & "checkout" , & "--" , & file] , Some ( & rust_path) ) ?;
1111
1094
}
1095
+ } else {
1096
+ println ! (
1097
+ "Failed to read `{}`, not putting back failing {} tests" ,
1098
+ file_path, test_type
1099
+ ) ;
1112
1100
}
1101
+
1113
1102
Ok ( true )
1114
1103
}
1115
1104
}
@@ -1121,6 +1110,7 @@ fn prepare_files_callback_success<'a>(
1121
1110
move |rust_path| {
1122
1111
let files = std:: fs:: read_to_string ( file_path) . unwrap_or_default ( ) ;
1123
1112
let first_file_name = files. lines ( ) . next ( ) . unwrap_or ( "" ) ;
1113
+ // If the first line ends with a `/`, we treat it as a directory.
1124
1114
if first_file_name. ends_with ( '/' ) {
1125
1115
if let Ok ( files) = std:: fs:: read_to_string ( file_path) {
1126
1116
for file in
0 commit comments