summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/test
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2023-01-31 10:34:18 +0100
committerFilip Tehlar <ftehlar@cisco.com>2023-02-24 14:38:15 +0100
commit671cf51d6d0b08c216a99696aa30f17faff5e653 (patch)
tree569ca122ed05396a4174c91c775d289b75769cf4 /extras/hs-test/test
parent182d2b466d158de4b2320fd280c1e7beb5bb37e4 (diff)
hs-test: improve test infra
- add support for building/running debug/release images - have one point of control (Makefile) - list all test cases Type: test Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I97949abc2fff85d7a2b3784122be159aeec72b52
Diffstat (limited to 'extras/hs-test/test')
-rwxr-xr-xextras/hs-test/test43
1 files changed, 32 insertions, 11 deletions
diff --git a/extras/hs-test/test b/extras/hs-test/test
index cd0a6e176f5..e14f3eecaa6 100755
--- a/extras/hs-test/test
+++ b/extras/hs-test/test
@@ -2,17 +2,38 @@
source vars
-for ARG in "$@"
+args=
+single_test=0
+persist_set=0
+
+for i in "$@"
do
- if [[ "$ARG" = "-p" ]]
- then
- export HST_PERSIST=1
- shift
- elif [[ "$ARG" = "-v" ]]
- then
- export HST_VERBOSE=1
- shift
- fi
+case "${i}" in
+ --persist=*)
+ persist="${i#*=}"
+ if [ $persist = "true" ]; then
+ args="$args -persist"
+ persist_set=1
+ fi
+ ;;
+ --verbose=*)
+ verbose="${i#*=}"
+ if [ $verbose = "true" ]; then
+ args="$args -verbose"
+ fi
+ ;;
+ --test=*)
+ tc_name="${i#*=}"
+ if [ $tc_name != "all" ]; then
+ single_test=1
+ args="$args -run $tc_name"
+ fi
+esac
done
-sudo -E go test -buildvcs=false -v $@
+if [ $single_test -eq 0 ] && [ $persist_set -eq 1 ]; then
+ echo "persist flag is not supperted while running all tests!"
+ exit 1
+fi
+
+sudo -E go test -buildvcs=false -v $args