Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to select the test targets #2491

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions kani-driver/src/args/playback_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ pub struct CargoPlaybackArgs {
#[command(flatten)]
pub playback: PlaybackArgs,

/// Test all binaries.
#[arg(long)]
pub bins: bool,

/// Test only the package's library unit tests.
#[arg(long)]
pub lib: bool,

/// Arguments to pass down to Cargo
#[command(flatten)]
pub cargo: CargoArgs,
Expand Down
8 changes: 8 additions & 0 deletions kani-driver/src/concrete_playback/playback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ fn cargo_test(install: &InstallType, args: CargoPlaybackArgs) -> Result<()> {
cargo_args.push("--no-run".into());
}

if args.bins {
cargo_args.push("--bins".into());
}

if args.lib {
cargo_args.push("--lib".into());
}

cargo_args.append(&mut args.cargo.to_cargo_args());
cargo_args.push("--target".into());
cargo_args.push(env!("TARGET").into());
Expand Down