Skip to content

Commit

Permalink
Add CI regression run for the write_goto_binary
Browse files Browse the repository at this point in the history
Modified `call_single_file.rs` so that write_goto_binary
can be enabled by defining the KANI_ENABLE_WRITE_GOTO_BINARY
env variable.
  • Loading branch information
Remi Delmas committed Feb 20, 2023
1 parent 7ae5088 commit 5fa1074
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ jobs:
- name: Execute Kani regression
run: ./scripts/kani-regression.sh

write-goto-binary-regression:
runs-on: ubuntu-20.04
env:
KANI_ENABLE_WRITE_GOTO_BINARY: 1
steps:
- name: Checkout Kani
uses: actions/checkout@v3

- name: Setup Kani Dependencies
uses: ./.github/actions/setup
with:
os: ubuntu-20.04

- name: Build Kani
run: cargo build-dev

- name: Execute Kani regression
run: ./scripts/kani-regression.sh

experimental-features-regression:
runs-on: ubuntu-20.04
env:
Expand Down
12 changes: 11 additions & 1 deletion kani-driver/src/call_single_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,19 @@ impl KaniSession {
if self.args.ignore_global_asm {
flags.push("--ignore-global-asm".into());
}
if self.args.write_goto_binary {

// When running regression runs, the write_goto_binary option is enabled
// by defining an environment variable.
// The value must be non-empty and different from zero.
let enable_write_goto_binary = match std::env::var_os("KANI_ENABLE_WRITE_GOTO_BINARY") {
Some(str) => !str.is_empty() && str != "0",
None => false,
};
// Users activate it via the command line switch
if self.args.write_goto_binary || enable_write_goto_binary {
flags.push("--write-goto-binary".into());
}

if self.args.enable_stubbing {
flags.push("--enable-stubbing".into());
}
Expand Down

0 comments on commit 5fa1074

Please sign in to comment.