File tree 1 file changed +19
-2
lines changed
src/tools/compiletest/src
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -2975,7 +2975,14 @@ impl<'test> TestCx<'test> {
2975
2975
let modes_to_prune = vec ! [ CompareMode :: Nll ] ;
2976
2976
self . prune_duplicate_outputs ( & modes_to_prune) ;
2977
2977
2978
- let mut errors = self . load_compare_outputs ( & proc_res, explicit) ;
2978
+ // if the user specified to check the results of the
2979
+ // run-pass test, delay loading and comparing output
2980
+ // until execution of the binary
2981
+ let mut errors = if !self . props . check_run_results {
2982
+ self . load_compare_outputs ( & proc_res, explicit)
2983
+ } else {
2984
+ 0
2985
+ } ;
2979
2986
2980
2987
if self . config . compare_mode . is_some ( ) {
2981
2988
// don't test rustfix with nll right now
@@ -3054,7 +3061,17 @@ impl<'test> TestCx<'test> {
3054
3061
3055
3062
if self . should_run_successfully ( ) {
3056
3063
let proc_res = self . exec_compiled_test ( ) ;
3057
-
3064
+ let run_output_errors = if self . props . check_run_results {
3065
+ self . load_compare_outputs ( & proc_res, explicit)
3066
+ } else {
3067
+ 0
3068
+ } ;
3069
+ if run_output_errors > 0 {
3070
+ self . fatal_proc_rec (
3071
+ & format ! ( "{} errors occured comparing run output." , run_output_errors) ,
3072
+ & proc_res,
3073
+ ) ;
3074
+ }
3058
3075
if !proc_res. status . success ( ) {
3059
3076
self . fatal_proc_rec ( "test run failed!" , & proc_res) ;
3060
3077
}
You can’t perform that action at this time.
0 commit comments