Message ID | 20201217144424.19414-4-pvorel@suse.cz |
---|---|
State | Accepted |
Headers | show |
Series | shell API setup/cleanup checks | expand |
Hi! Looks good, Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index dbf1d2a97..1b05c1036 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -586,7 +586,11 @@ tst_run() [ -n "$TST_NEEDS_MODULE" ] && tst_require_module "$TST_NEEDS_MODULE" if [ -n "$TST_SETUP" ]; then - $TST_SETUP + if type $TST_SETUP >/dev/null 2>/dev/null; then + $TST_SETUP + else + tst_brk TBROK "TST_SETUP=$TST_SETUP declared, but function not defined (or cmd not found)" + fi fi #TODO check that test reports some results for each test function call
It can lead to fail positive when just warn about TST_SETUP declared but not defined (or cmd not found). Signed-off-by: Petr Vorel <pvorel@suse.cz> --- testcases/lib/tst_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)