test: Streamline test suite a little

This change aims to streamline the integrationtest suite and reduce friction when running (parts of) test suites.

Changes:
- add `test-testname` to makefile to easily run one suite
- made skipping tests first class citizen in test.sh (all available testsuites and the reasons they are skipped are now better exposed and discovered)
- suppress some output of gotest unless there is an error
- no longer build binary for examples and gotest suites
- removed .SILENT from makefile as it being applied to only some targets makes it feel weird (I just learned about this option btw, feel free to comment on this change)
- move individual tests out of `test.sh` and into `test-misc.sh`
- introduced the concept of testsuites to `test.sh`
This commit is contained in:
Johan Bloemberg
2018-02-15 17:17:25 +01:00
parent 8b9491823d
commit b34b359860
21 changed files with 184 additions and 63 deletions

View File

@@ -2,7 +2,7 @@
# simple test harness for testing mgmt
# NOTE: this will rm -rf /tmp/mgmt/
echo running test-shell.sh
echo running "$0"
set -o errexit
set -o pipefail
@@ -21,7 +21,6 @@ fi
LINE=$(printf '=%.0s' `seq -s ' ' $(tput cols)`) # a terminal width string
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" # dir!
cd "$DIR" >/dev/null # work from main mgmt directory
make build
MGMT="$DIR/test/shell/mgmt"
cp -a "$DIR/mgmt" "$MGMT" # put a copy there
failures=""
@@ -67,10 +66,6 @@ for i in $DIR/test/shell/*.sh; do
fi
done
# clean up
rm -f "$MGMT"
make clean
if [ "$count" = '0' ]; then
fail_test 'No tests were run!'
fi