tests: misc: skip a test if the absolute top build dir is unsafe

Without this change, this test would fail during 'make distcheck', for
example.

* tests/misc/exec-bad-unicode.sh: Skip the test if $abs_top_builddir has
spaces or special characters.
* cfg.mk (_tb_misc): Also match tests/misc/exec-bad-unicode.sh.
Reported by Bruno Haible.
This commit is contained in:
Collin Funk committed 2026-10-06 20:21:43 -07:00
1 parent d5ee8b245c
commit 9a38bb9186
2 files changed
+10 -1

No files matched your search

+1 -1
View File
@@ -988,7 +988,7 @@ exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \
^src/(system\.h|od\.c|printf\.c|getlimits\.c)$$
_cksum = ^tests/cksum/cksum-base64\.pl$$
_tb_misc = misc/(stdbuf|responsive)
_tb_misc = misc/(exec-bad-unicode|stdbuf|responsive)
exclude_file_name_regexp--sc_prohibit_test_backticks = \
^tests/(local\.mk|(init|$(_tb_misc)|factor/create-test)\.sh)$$|$(_cksum)
+9
View File
@@ -19,6 +19,15 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
# stdbuf fails when the absolute top build dir name contains e.g.,
# space, TAB, NL
lf='
'
case $abs_top_builddir in
*[\\\"\#\$\&\'\`$lf\ \ ]*)
skip_ "unsafe absolute build directory name: $abs_top_builddir";;
esac
script="$(bad_unicode)"
# Create a program with invalid Unicode in its name.