Skip to content

Commit b2d4250

Browse files
committed
Verify that testcase is a defined function
1 parent f34eb1d commit b2d4250

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/testrunner.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ function testrunner::run_tests() {
112112
exec 4< $test_output_file
113113

114114
local all_testcases=($(grep "function .*()" $testsuite | grep -o "test_[a-zA-Z_]*"))
115+
for testcase_num in "${!all_testcases[@]}"; do
116+
testcase="${all_testcases[$testcase_num]}"
117+
# Make sure testcase is actually a defined function
118+
if ! testrunner::function_declared $testcase; then
119+
unset 'all_testcases[testcase_num]'
120+
fi
121+
done
122+
115123
local requested_testcases=$testcases
116124
if [[ -z $testcases ]]; then
117125
testcases=("${all_testcases[@]}")

0 commit comments

Comments
 (0)