Skip to content

Commit

Permalink
Fix test and missing conflict detection
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval committed Jul 3, 2024
1 parent 84f0e27 commit 418548f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions kani-driver/src/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,13 @@ impl ValidateArgs for VerificationArgs {
--output-format=old.",
));
}
if self.concrete_playback.is_some() && self.is_stubbing_enabled() {
// Concrete playback currently does not work with contracts or stubbing.
return Err(Error::raw(
ErrorKind::ArgumentConflict,
"Conflicting options: --concrete-playback isn't compatible with stubbing.",
));
}
if self.concrete_playback.is_some() && self.jobs() != Some(1) {
// Concrete playback currently embeds a lot of assumptions about the order in which harnesses get called.
return Err(Error::raw(
Expand Down Expand Up @@ -864,13 +871,18 @@ mod tests {

#[test]
fn check_enable_stubbing() {
check_unstable_flag!("--enable-stubbing --harness foo", enable_stubbing);
let res = parse_unstable_disabled("--harness foo").unwrap();
assert!(!res.verify_opts.is_stubbing_enabled());

check_unstable_flag!("--enable-stubbing", enable_stubbing);
let res = parse_unstable_disabled("--harness foo -Z stubbing").unwrap();
assert!(res.verify_opts.is_stubbing_enabled());

// `-Z stubbing` cannot be called with `--concrete-playback`
let err = parse_unstable_enabled("-Z stubbing --harness foo --concrete-playback=print")
.unwrap_err();
let res = parse_unstable_disabled(
"--harness foo --concrete-playback=print -Z concrete-playback -Z stubbing",
)
.unwrap();
let err = res.validate().unwrap_err();
assert_eq!(err.kind(), ErrorKind::ArgumentConflict);
}

Expand Down

0 comments on commit 418548f

Please sign in to comment.