Fix cargo-build/test-bpf --workspace (#16431)
This commit is contained in:
parent
388ce12207
commit
878e52f0b9
|
@ -44,14 +44,10 @@ test-stable-perf)
|
||||||
./cargo-build-bpf --manifest-path sdk/Cargo.toml
|
./cargo-build-bpf --manifest-path sdk/Cargo.toml
|
||||||
|
|
||||||
# BPF Program unit tests
|
# BPF Program unit tests
|
||||||
for program in programs/bpf/rust/*; do
|
"$cargo" test --manifest-path programs/bpf/Cargo.toml
|
||||||
if [ -d "${program}" ]; then
|
cargo-build-bpf --manifest-path programs/bpf/Cargo.toml --bpf-sdk sdk/bpf
|
||||||
_ "$cargo" test --manifest-path "$program"/Cargo.toml
|
|
||||||
_ cargo-build-bpf --manifest-path "$program"/Cargo.toml --bpf-sdk sdk/bpf
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# BPF program tests
|
# BPF program system tests
|
||||||
_ make -C programs/bpf/c tests
|
_ make -C programs/bpf/c tests
|
||||||
_ "$cargo" stable test \
|
_ "$cargo" stable test \
|
||||||
--manifest-path programs/bpf/Cargo.toml \
|
--manifest-path programs/bpf/Cargo.toml \
|
||||||
|
|
|
@ -401,8 +401,14 @@ fn build_bpf(config: Config, manifest_path: Option<PathBuf>) {
|
||||||
.packages
|
.packages
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|package| {
|
.filter(|package| {
|
||||||
package.manifest_path.with_file_name("Xargo.toml").exists()
|
if metadata.workspace_members.contains(&package.id) {
|
||||||
&& metadata.workspace_members.contains(&package.id)
|
for target in package.targets.iter() {
|
||||||
|
if target.kind.contains(&"cdylib".to_string()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
|
|
@ -152,8 +152,14 @@ fn test_bpf(config: Config, manifest_path: Option<PathBuf>) {
|
||||||
.packages
|
.packages
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|package| {
|
.filter(|package| {
|
||||||
package.manifest_path.with_file_name("Xargo.toml").exists()
|
if metadata.workspace_members.contains(&package.id) {
|
||||||
&& metadata.workspace_members.contains(&package.id)
|
for target in package.targets.iter() {
|
||||||
|
if target.kind.contains(&"cdylib".to_string()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue