2019-07-16 09:54:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source $HOME/.cargo/env
|
|
|
|
|
2019-07-19 07:57:20 +00:00
|
|
|
# More effective than just cargo test --all as it captures crates within crates
|
|
|
|
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
|
2019-07-16 09:54:33 +00:00
|
|
|
|
|
|
|
pushd target/debug
|
2019-07-19 07:57:20 +00:00
|
|
|
ls | grep net_util | grep -v "\.d" | xargs -n 1 sudo setcap cap_net_admin,cap_net_raw+ep
|
2019-07-16 09:54:33 +00:00
|
|
|
popd
|
|
|
|
|
2019-08-16 14:11:47 +00:00
|
|
|
sudo adduser $USER kvm
|
|
|
|
newgrp kvm << EOF || exit 1
|
|
|
|
for f in \$(find . -name Cargo.toml -printf '%h\n' | sort -u); do
|
|
|
|
pushd \$f > /dev/null;
|
2019-08-16 15:08:16 +00:00
|
|
|
export RUST_BACKTRACE=1
|
2019-07-16 09:54:33 +00:00
|
|
|
cargo test || exit 1;
|
|
|
|
popd > /dev/null;
|
|
|
|
done
|
2019-08-16 14:11:47 +00:00
|
|
|
EOF
|