Merge branch 'tc/t0450-harden'

Test updates.

* tc/t0450-harden:
  t0450: add allowlist for builtins with missing .adoc
  t0450: fix test for out-of-tree builds
This commit is contained in:
Junio C Hamano
2025-09-12 10:41:21 -07:00
2 changed files with 21 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ help_to_synopsis () {
}
builtin_to_adoc () {
echo "$GIT_BUILD_DIR/Documentation/git-$1.adoc"
echo "$GIT_SOURCE_DIR/Documentation/git-$1.adoc"
}
adoc_to_synopsis () {
@@ -112,10 +112,19 @@ do
adoc="$(builtin_to_adoc "$builtin")" &&
preq="$(echo BUILTIN_ADOC_$builtin | tr '[:lower:]-' '[:upper:]_')" &&
if test -f "$adoc"
# If and only if *.adoc is missing, builtin shall be listed in t0450/adoc-missing.
if grep -q "^$builtin$" "$TEST_DIRECTORY"/t0450/adoc-missing
then
test_expect_success "$builtin appropriately marked as not having .adoc" '
! test -f "$adoc"
'
else
test_set_prereq "$preq"
fi &&
test_expect_success "$builtin appropriately marked as having .adoc" '
test -f "$adoc"
'
fi
# *.adoc output assertions
test_expect_success "$preq" "$builtin *.adoc SYNOPSIS has dashed labels" '

9
t/t0450/adoc-missing Normal file
View File

@@ -0,0 +1,9 @@
checkout--worker
merge-ours
merge-recursive
merge-recursive-ours
merge-recursive-theirs
merge-subtree
pickaxe
submodule--helper
upload-archive--writer