mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: Use the workspace to unit test all the crates
Make all the crates members of the workspace so that "cargo test --workspace" will find them all and test them with the features enabled that we use. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
b6f6772df4
commit
134bcd84e6
15
Cargo.toml
15
Cargo.toml
@@ -48,5 +48,20 @@ integration_tests = []
|
|||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
|
"arch",
|
||||||
|
"devices",
|
||||||
|
"vhost_rs",
|
||||||
|
"qcow",
|
||||||
|
"pci",
|
||||||
|
"vmm",
|
||||||
|
"vm-virtio",
|
||||||
|
"vm-device",
|
||||||
"vhost_user_backend",
|
"vhost_user_backend",
|
||||||
|
"vhost_user_fs",
|
||||||
|
"vfio",
|
||||||
|
"net_util",
|
||||||
|
"acpi_tables",
|
||||||
|
"arch_gen",
|
||||||
|
"net_gen",
|
||||||
|
"vm-allocator",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -2,23 +2,13 @@
|
|||||||
|
|
||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
|
|
||||||
# More effective than just cargo test --all as it captures crates within crates
|
cargo test --workspace --no-run
|
||||||
for f in $(find . -name Cargo.toml -printf '%h\n' | sort -u); do
|
|
||||||
pushd $f > /dev/null;
|
|
||||||
cargo test --no-run || exit 1;
|
|
||||||
popd > /dev/null;
|
|
||||||
done
|
|
||||||
|
|
||||||
pushd target/debug
|
pushd target/debug
|
||||||
ls | grep net_util | grep -v "\.d" | xargs -n 1 sudo setcap cap_net_admin,cap_net_raw+ep
|
ls | grep net_util | grep -v "\.d" | xargs -n 1 sudo setcap cap_net_admin,cap_net_raw+ep
|
||||||
popd
|
popd
|
||||||
|
|
||||||
sudo adduser $USER kvm
|
sudo adduser $USER kvm
|
||||||
newgrp kvm << EOF || exit 1
|
newgrp kvm << EOF || exit 1
|
||||||
for f in \$(find . -name Cargo.toml -printf '%h\n' | sort -u); do
|
|
||||||
pushd \$f > /dev/null;
|
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
cargo test || exit 1;
|
cargo test --workspace || exit 1;
|
||||||
popd > /dev/null;
|
|
||||||
done
|
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user