@@ -119,3 +119,56 @@ fn list_with_config_file_regexps() {
119119 "src/simple_fns.rs:17: replace divisible_by_three -> bool with false\n " ,
120120 ) ) ;
121121}
122+
123+ #[ test]
124+ fn tree_fails_without_needed_feature ( ) {
125+ // The point of this tree is to check that Cargo features can be turned on,
126+ // but let's make sure it does fail as intended if they're not.
127+ let testdata = copy_of_testdata ( "fails_without_feature" ) ;
128+ run_assert_cmd ( )
129+ . args ( [ "mutants" , "-d" ] )
130+ . arg ( testdata. path ( ) )
131+ . assert ( )
132+ . failure ( )
133+ . stdout ( predicates:: str:: contains (
134+ "test failed in an unmutated tree" ,
135+ ) ) ;
136+ }
137+
138+ #[ test]
139+ fn additional_cargo_args ( ) {
140+ // The point of this tree is to check that Cargo features can be turned on,
141+ // but let's make sure it does fail as intended if they're not.
142+ let testdata = copy_of_testdata ( "fails_without_feature" ) ;
143+ write_config_file (
144+ & testdata,
145+ r#"
146+ additional_cargo_args = ["--features", "needed"]
147+ "# ,
148+ ) ;
149+ run_assert_cmd ( )
150+ . args ( [ "mutants" , "-d" ] )
151+ . arg ( testdata. path ( ) )
152+ . assert ( )
153+ . success ( )
154+ . stdout ( predicates:: str:: contains ( "1 caught" ) ) ;
155+ }
156+
157+ #[ test]
158+ fn additional_cargo_test_args ( ) {
159+ // The point of this tree is to check that Cargo features can be turned on,
160+ // but let's make sure it does fail as intended if they're not.
161+ let testdata = copy_of_testdata ( "fails_without_feature" ) ;
162+ write_config_file (
163+ & testdata,
164+ r#"
165+ additional_cargo_test_args = ["--all-features", ]
166+ "# ,
167+ ) ;
168+ run_assert_cmd ( )
169+ . args ( [ "mutants" , "-d" ] )
170+ . arg ( testdata. path ( ) )
171+ . assert ( )
172+ . success ( )
173+ . stdout ( predicates:: str:: contains ( "1 caught" ) ) ;
174+ }
0 commit comments