aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/hs_test.sh
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-07-19 16:04:09 +0200
committerFlorin Coras <florin.coras@gmail.com>2024-07-22 17:44:42 +0000
commite99d266612b53163d460f3ceab96934b1d961ac8 (patch)
treeb0bf01f2802f2a7c282ff268b48bd412edfd3c98 /extras/hs-test/hs_test.sh
parent7f163b682a57f42bd9b39a7f2d7e4c1c67df8386 (diff)
hs-test: memory leak testing
add infra for memory leak testing Type: test Change-Id: I882e8dbb360597cdb82ad52682725f7d39b2df24 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test/hs_test.sh')
-rw-r--r--extras/hs-test/hs_test.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/extras/hs-test/hs_test.sh b/extras/hs-test/hs_test.sh
index 803b8f717da..acad7ebbc75 100644
--- a/extras/hs-test/hs_test.sh
+++ b/extras/hs-test/hs_test.sh
@@ -7,8 +7,10 @@ single_test=0
persist_set=0
unconfigure_set=0
debug_set=0
+leak_check_set=0
debug_build=
ginkgo_args=
+tc_name=
for i in "$@"
do
@@ -74,6 +76,13 @@ case "${i}" in
args="$args -cpu0"
fi
;;
+ --leak_check=*)
+ leak_check="${i#*=}"
+ if [ "$leak_check" = "true" ]; then
+ args="$args -leak_check"
+ leak_check_set=1
+ fi
+ ;;
esac
done
@@ -97,6 +106,16 @@ if [ $single_test -eq 0 ] && [ $debug_set -eq 1 ]; then
exit 1
fi
+if [ $leak_check_set -eq 1 ]; then
+ if [ $single_test -eq 0 ]; then
+ echo "a single test has to be specified when leak_check is set"
+ exit 1
+ fi
+ ginkgo_args="--focus $tc_name"
+ sudo -E go run github.com/onsi/ginkgo/v2/ginkgo $ginkgo_args -- $args
+ exit 0
+fi
+
mkdir -p summary
# shellcheck disable=SC2086
sudo -E go run github.com/onsi/ginkgo/v2/ginkgo --no-color --trace --json-report=summary/report.json $ginkgo_args -- $args