Add cargo-bpf-test --no-run flag, matching cargo-test
This commit is contained in:
committed by
mergify[bot]
parent
4be9d7fd29
commit
eb19e11688
@ -18,6 +18,7 @@ struct Config {
|
|||||||
features: Vec<String>,
|
features: Vec<String>,
|
||||||
test_name: Option<String>,
|
test_name: Option<String>,
|
||||||
no_default_features: bool,
|
no_default_features: bool,
|
||||||
|
no_run: bool,
|
||||||
offline: bool,
|
offline: bool,
|
||||||
verbose: bool,
|
verbose: bool,
|
||||||
workspace: bool,
|
workspace: bool,
|
||||||
@ -34,6 +35,7 @@ impl Default for Config {
|
|||||||
features: vec![],
|
features: vec![],
|
||||||
test_name: None,
|
test_name: None,
|
||||||
no_default_features: false,
|
no_default_features: false,
|
||||||
|
no_run: false,
|
||||||
offline: false,
|
offline: false,
|
||||||
verbose: false,
|
verbose: false,
|
||||||
workspace: false,
|
workspace: false,
|
||||||
@ -109,6 +111,10 @@ fn test_bpf_package(config: &Config, target_directory: &Path, package: &cargo_me
|
|||||||
cargo_args.push(test_name);
|
cargo_args.push(test_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.no_run {
|
||||||
|
cargo_args.push("--no-run");
|
||||||
|
}
|
||||||
|
|
||||||
// If the program crate declares the "test-bpf" feature, pass it along to the tests so they can
|
// If the program crate declares the "test-bpf" feature, pass it along to the tests so they can
|
||||||
// distinguish between `cargo test` and `cargo test-bpf`
|
// distinguish between `cargo test` and `cargo test-bpf`
|
||||||
if set_test_bpf_feature {
|
if set_test_bpf_feature {
|
||||||
@ -215,6 +221,12 @@ fn main() {
|
|||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("Place final BPF build artifacts in this directory"),
|
.help("Place final BPF build artifacts in this directory"),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("no_run")
|
||||||
|
.long("no-run")
|
||||||
|
.takes_value(false)
|
||||||
|
.help("Compile, but don't run tests"),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("offline")
|
Arg::with_name("offline")
|
||||||
.long("offline")
|
.long("offline")
|
||||||
@ -255,6 +267,7 @@ fn main() {
|
|||||||
.unwrap_or_else(Vec::new),
|
.unwrap_or_else(Vec::new),
|
||||||
test_name: value_t!(matches, "test", String).ok(),
|
test_name: value_t!(matches, "test", String).ok(),
|
||||||
no_default_features: matches.is_present("no_default_features"),
|
no_default_features: matches.is_present("no_default_features"),
|
||||||
|
no_run: matches.is_present("no_run"),
|
||||||
offline: matches.is_present("offline"),
|
offline: matches.is_present("offline"),
|
||||||
verbose: matches.is_present("verbose"),
|
verbose: matches.is_present("verbose"),
|
||||||
workspace: matches.is_present("workspace"),
|
workspace: matches.is_present("workspace"),
|
||||||
|
Reference in New Issue
Block a user