From 791c9c40f0d236fdc7e8a5db4c689f5554dc5fe6 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 12 Nov 2025 07:48:17 -0500 Subject: [PATCH] Allow for executing a specific set of tests on the command line --- bin/shunit.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/shunit.sh b/bin/shunit.sh index b22aff1..b8ffa1a 100644 --- a/bin/shunit.sh +++ b/bin/shunit.sh @@ -35,7 +35,12 @@ for file in $FILES; do declare -A tests source $file - for key in $(declare -F | grep 'shunittest_') + if [[ "${cmdarg_argv[@]}" == "" ]]; then + keys=$(declare -F | grep shunittest_ | sort) + else + keys=$(echo ${cmdarg_argv[*]} | tr ' ' '\n' | sort) + fi + for key in ${keys} do if [[ "$(type -t $key)" == "function" ]]; then start=$(date "+%s")