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 3f193d1
Show file tree
Hide file tree
Showing 2 changed files with 27 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
9 changes: 8 additions & 1 deletion kani-driver/src/call_single_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ impl KaniSession {
pub fn kani_compiler_flags(&self) -> Vec<String> {
let mut flags = vec![];

// Read write_goto_binary option from env
let env_var = "KANI_ENABLE_WRITE_GOTO_BINARY";
let enable_write_goto_binary = match std::env::var_os(env_var) {
Some(str) => !str.is_empty() && str != "0",
None => false,
};

if self.args.debug {
flags.push("--log-level=debug".into());
} else if self.args.verbose {
Expand All @@ -86,7 +93,7 @@ impl KaniSession {
if self.args.ignore_global_asm {
flags.push("--ignore-global-asm".into());
}
if self.args.write_goto_binary {
if self.args.write_goto_binary || enable_write_goto_binary {
flags.push("--write-goto-binary".into());
}
if self.args.enable_stubbing {
Expand Down

0 comments on commit 3f193d1

Please sign in to comment.