@@ -33,6 +33,10 @@ pub struct Config {
3333 /// An exit code that should be considered as success for test executables (applies to
3434 /// `bootimage runner`)
3535 pub test_success_exit_code : Option < i32 > ,
36+ /// Whether the `-no-reboot` flag should be passed to test executables
37+ ///
38+ /// Defaults to `true`
39+ pub test_no_reboot : bool ,
3640}
3741
3842/// Reads the configuration from a `package.metadata.bootimage` in the given Cargo.toml.
@@ -91,6 +95,9 @@ fn read_config_inner(manifest_path: &Path) -> Result<Config> {
9195 ( "test-args" , Value :: Array ( array) ) => {
9296 config. test_args = Some ( parse_string_array ( array, "test-args" ) ?) ;
9397 }
98+ ( "test-no-reboot" , Value :: Boolean ( no_reboot) ) => {
99+ config. test_no_reboot = Some ( no_reboot) ;
100+ }
94101 ( key, value) => {
95102 return Err ( anyhow ! (
96103 "unexpected `package.metadata.bootimage` \
@@ -123,6 +130,7 @@ struct ConfigBuilder {
123130 test_args : Option < Vec < String > > ,
124131 test_timeout : Option < u32 > ,
125132 test_success_exit_code : Option < i32 > ,
133+ test_no_reboot : Option < bool > ,
126134}
127135
128136impl Into < Config > for ConfigBuilder {
@@ -140,6 +148,7 @@ impl Into<Config> for ConfigBuilder {
140148 test_args : self . test_args ,
141149 test_timeout : self . test_timeout . unwrap_or ( 60 * 5 ) ,
142150 test_success_exit_code : self . test_success_exit_code ,
151+ test_no_reboot : self . test_no_reboot . unwrap_or ( true ) ,
143152 }
144153 }
145154}
0 commit comments