Skip to content

Commit c3ff7be

Browse files
avargitster
authored andcommitted
test-lib tests: don't provide a description for the sub-tests
Change the $test_description provided for the generated subtests to be constant, since the only purpose of having it is that test-lib.sh will barf if it isn't supplied. The other purpose of having it was to effectively split up the test description between the argument to test_expect_success and the argument to "write_and_run_sub_test_lib_test". Let's only use one of the two. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9f0a452 commit c3ff7be

File tree

2 files changed

+66
-88
lines changed

2 files changed

+66
-88
lines changed

t/lib-subtest.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
write_sub_test_lib_test () {
2-
name="$1" descr="$2" # stdin is the body of the test code
2+
name="$1" # stdin is the body of the test code
33
mkdir "$name" &&
44
write_script "$name/$name.sh" "$TEST_SHELL_PATH" <<-EOF &&
5-
test_description='$descr (run in sub test-lib)
6-
7-
This is run in a sub test-lib so that we do not get incorrect
8-
passing metrics
9-
'
5+
test_description='A test of test-lib.sh itself'
106
117
# Point to the t/test-lib.sh, which isn't in ../ as usual
128
. "\$TEST_DIRECTORY"/test-lib.sh
@@ -15,8 +11,8 @@ write_sub_test_lib_test () {
1511
}
1612

1713
_run_sub_test_lib_test_common () {
18-
neg="$1" name="$2" descr="$3" # stdin is the body of the test code
19-
shift 3
14+
neg="$1" name="$2" # stdin is the body of the test code
15+
shift 2
2016

2117
# intercept pseudo-options at the front of the argument list that we
2218
# will not pass to child script

0 commit comments

Comments
 (0)