ci: Add timing info to test builds
To help determine where time is being spent in tests, add a 'time'
command to the test invocation script. In addition, split the test
invocation into a separate build and run stage. This can be useful with
another change to ptest that logs all test outputs instead of just
failures.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/ci/sim_run.sh b/ci/sim_run.sh
index 6c0e3f2..59d65e1 100755
--- a/ci/sim_run.sh
+++ b/ci/sim_run.sh
@@ -25,14 +25,16 @@
if [[ ! -z $SINGLE_FEATURES ]]; then
if [[ $SINGLE_FEATURES =~ "none" ]]; then
echo "Running cargo with no features"
- cargo test
+ time cargo test --no-run
+ time cargo test
rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc
fi
for feature in $all_features; do
if [[ $SINGLE_FEATURES =~ $feature ]]; then
echo "Running cargo for feature=\"${feature}\""
- cargo test --features $feature
+ time cargo test --no-run --features $feature
+ time cargo test --features $feature
rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc
fi
done
@@ -43,7 +45,8 @@
read -ra multi_features <<< "$MULTI_FEATURES"
for features in "${multi_features[@]}"; do
echo "Running cargo for features=\"${features}\""
- cargo test --features "$features"
+ time cargo test --no-run --features "$features"
+ time cargo test --features "$features"
rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc
done
fi