File tree Expand file tree Collapse file tree 11 files changed +18
-24
lines changed
cargo_autoharness_contracts
cargo_autoharness_dependencies
cargo_autoharness_harnesses_fail
cargo_autoharness_termination_timeout
cargo_autoharness_termination_unwind
cargo_autoharness_type_invariant Expand file tree Collapse file tree 11 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,10 @@ impl KaniSession {
200200 }
201201
202202 /// Prints the results from running the `autoharness` subcommand.
203- pub fn print_autoharness_summary ( & self , mut automatic : Vec < & HarnessResult < ' _ > > ) -> Result < ( ) > {
203+ pub fn print_autoharness_summary (
204+ & self ,
205+ mut automatic : Vec < & HarnessResult < ' _ > > ,
206+ ) -> Result < usize > {
204207 automatic. sort_by ( |a, b| a. harness . pretty_name . cmp ( & b. harness . pretty_name ) ) ;
205208 let ( successes, failures) : ( Vec < _ > , Vec < _ > ) =
206209 automatic. into_iter ( ) . partition ( |r| r. result . status == VerificationStatus :: Success ) ;
@@ -258,6 +261,6 @@ impl KaniSession {
258261 println ! ( "No functions were eligible for automatic verification." ) ;
259262 }
260263
261- Ok ( ( ) )
264+ Ok ( failing )
262265 }
263266}
Original file line number Diff line number Diff line change @@ -298,11 +298,13 @@ impl KaniSession {
298298 self . show_coverage_summary ( ) ?;
299299 }
300300
301- if self . autoharness_compiler_flags . is_some ( ) {
302- self . print_autoharness_summary ( automatic) ?;
303- }
301+ let autoharness_failing = if self . autoharness_compiler_flags . is_some ( ) {
302+ self . print_autoharness_summary ( automatic) ?
303+ } else {
304+ 0
305+ } ;
304306
305- if failing > 0 && self . autoharness_compiler_flags . is_none ( ) {
307+ if failing + autoharness_failing > 0 {
306308 // Failure exit code without additional error message
307309 drop ( self ) ;
308310 std:: process:: exit ( 1 ) ;
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0 OR MIT
33script : contracts.sh
44expected : contracts.expected
5+ exit_code : 1
Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: Apache-2.0 OR MIT
44
55cargo kani autoharness -Z autoharness
6- # We expect verification to fail, so the above command will produce an exit status of 1
7- # However, we don't want the test to fail because of that exit status; we only want it to fail if the expected file doesn't match
8- # So, exit with a status code of 0 explicitly.
9- exit 0;
Original file line number Diff line number Diff line change 22# Copyright Kani Contributors
33# SPDX-License-Identifier: Apache-2.0 OR MIT
44
5- cargo kani autoharness -Z autoharness
6- # We expect verification to fail, so the above command will produce an exit status of 1
7- # However, we don't want the test to fail because of that exit status; we only want it to fail if the expected file doesn't match
8- # So, exit with a status code of 0 explicitly.
9- exit 0;
5+ cargo kani autoharness -Z autoharness
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0 OR MIT
33script : harnesses_fail.sh
44expected : harnesses_fail.expected
5+ exit_code : 1
Original file line number Diff line number Diff line change 22# Copyright Kani Contributors
33# SPDX-License-Identifier: Apache-2.0 OR MIT
44
5- cargo kani autoharness -Z autoharness
6- # We expect verification to fail, so the above command will produce an exit status of 1
7- # However, we don't want the test to fail because of that exit status; we only want it to fail if the expected file doesn't match
8- # So, exit with a status code of 0 explicitly.
9- exit 0;
5+ cargo kani autoharness -Z autoharness
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0 OR MIT
33script : termination_timeout.sh
44expected : termination_timeout.expected
5+ exit_code : 1
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0 OR MIT
33script : termination_unwind.sh
44expected : termination_unwind.expected
5+ exit_code : 1
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0 OR MIT
33script : type-invariant.sh
44expected : type-invariant.expected
5+ exit_code : 1
You can’t perform that action at this time.
0 commit comments