Skip to content

Commit

Permalink
Test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshikiTakashima committed Jun 7, 2023
1 parent 0a90818 commit c7f9044
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/script-based-pre/zero-size/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT
script: playback_opts.sh
expected: playback_opts.expected
11 changes: 11 additions & 0 deletions tests/script-based-pre/zero-size/original.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! This checks that Kani zero-size playback, 2 of them in a row.
#[kani::proof]
fn any_is_ok() {
let unit: () = kani::any();
let unit2: () = kani::any();
kani::cover!(unit == ());
kani::cover!(unit2 == ());
}
5 changes: 5 additions & 0 deletions tests/script-based-pre/zero-size/playback_opts.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[TEST] Generate test...
Checking harness any_is_ok

[TEST] Run test...
test result: ok. 1 passed; 0 failed;
18 changes: 18 additions & 0 deletions tests/script-based-pre/zero-size/playback_opts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Test that concrete playback -Z concrete-playback executes as expected
set -o pipefail
set -o nounset

RS_FILE="modified.rs"
cp original.rs ${RS_FILE}

echo "[TEST] Generate test..."
kani ${RS_FILE} -Z concrete-playback --concrete-playback=inplace

echo "[TEST] Run test..."
kani playback -Z concrete-playback ${RS_FILE} -- kani_concrete_playback

# Cleanup
rm ${RS_FILE}

0 comments on commit c7f9044

Please sign in to comment.