build: Run unit tests on the Jenkins server

The addition of [workspace] to the top level Cargo.toml is necessary to
have the binaries colocated together.

The Cargo.lock files have also been refreshed by the change to the
Cargo.toml.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-07-16 10:54:33 +01:00
committed by Samuel Ortiz
parent 1dfe16c382
commit 78fe807284
5 changed files with 341 additions and 0 deletions

16
scripts/run_unit_tests.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
source $HOME/.cargo/env
cargo test --all --no-run
pushd target/debug
ls | grep net_util | grep -v "\.d" | xargs sudo setcap cap_net_admin,cap_net_raw+ep
popd
# 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 || exit 1;
popd > /dev/null;
done