1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00

ctdb-tests: Add function test_case(), tweak unit test header format

Instead of documenting test cases with a comment, this allows them to
be documented via an argument to a function that is printed when the
test case is run.  This makes it easier locate test case failures when
commands used by test cases look similar,

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2022-03-01 09:27:50 +11:00 committed by Amitay Isaacs
parent c413838f79
commit 381134939b

View File

@ -184,10 +184,20 @@ test_fail()
return 1 return 1
} }
test_case_string=""
test_case()
{
test_case_string="$*"
}
test_header_default() test_header_default()
{ {
echo "==================================================" echo "=================================================="
echo "Running \"$*\"" if [ -n "$test_case_string" ]; then
echo "Summary: ${test_case_string}"
test_case_string=""
fi
echo "Running: $*"
} }
reset_test_header() reset_test_header()