@@ -36,8 +36,7 @@ pub struct Config {
36
36
/// The binary to actually execute.
37
37
pub program : CommandBuilder ,
38
38
/// What to do in case the stdout/stderr output differs from the expected one.
39
- pub output_conflict_handling :
40
- fn ( path : & Path , actual : Vec < u8 > , errors : & mut Errors , config : & Config ) ,
39
+ pub output_conflict_handling : OutputConflictHandling ,
41
40
/// The recommended command to bless failing tests.
42
41
pub bless_command : Option < String > ,
43
42
/// Where to dump files like the binaries compiled from tests.
@@ -69,6 +68,9 @@ pub struct Config {
69
68
pub abort_check : Arc < AtomicBool > ,
70
69
}
71
70
71
+ /// Function that performs the actual output conflict handling.
72
+ pub type OutputConflictHandling = fn ( & Path , Vec < u8 > , & mut Errors , & Config ) ;
73
+
72
74
impl Config {
73
75
/// Create a blank configuration that doesn't do anything interesting
74
76
pub fn dummy ( ) -> Self {
@@ -200,7 +202,14 @@ impl Config {
200
202
201
203
config. custom_comments . insert ( "run" , |parser, args, span| {
202
204
let set = |exit_code| {
203
- parser. set_custom_once ( "run" , Run { exit_code } , args. span ( ) ) ;
205
+ parser. set_custom_once (
206
+ "run" ,
207
+ Run {
208
+ exit_code,
209
+ output_conflict_handling : None ,
210
+ } ,
211
+ args. span ( ) ,
212
+ ) ;
204
213
parser. exit_status = Spanned :: new ( 0 , span. clone ( ) ) . into ( ) ;
205
214
parser. require_annotations = Spanned :: new ( false , span. clone ( ) ) . into ( ) ;
206
215
0 commit comments