Skip to content

Commit a7c8984

Browse files
committed
Making the list of the tests to be run created dynamically and added comments
1 parent e9357bc commit a7c8984

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

util/run-gnu-test.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ if test $# -ge 1; then
5454
done
5555
fi
5656

57-
if [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then
57+
if [[ "$1" == "run-tty" ]]; then
58+
# Handle TTY tests - dynamically find tests requiring TTY
59+
shift
60+
TTY_TESTS=$(grep -r "require_controlling_input_terminal" tests --include="*.sh" --include="*.pl" -l 2>/dev/null | tr '\n' ' ')
61+
echo "Running TTY tests: $TTY_TESTS"
62+
script -qec "timeout -sKILL 1h '${MAKE}' -j '$(${NPROC})' check TESTS='$TTY_TESTS' SUBDIRS=. RUN_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit='' srcdir='${path_GNU}' TEST_SUITE_LOG='tests/test-suite-tty.log'" /dev/null || :
63+
exit 0
64+
elif [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then
5865
# Handle SELinux root tests separately
5966
shift
6067
if test -n "$CI"; then
@@ -63,7 +70,7 @@ if [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then
6370
sudo "${MAKE}" -j "$("${NPROC}")" check TESTS="$*" SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit="" srcdir="${path_GNU}" TEST_SUITE_LOG="tests/test-suite-root.log" || :
6471
fi
6572
exit 0
66-
elif test "$1" != "run-root"; then
73+
elif test "$1" != "run-root" && test "$1" != "run-tty"; then
6774
if test $# -ge 1; then
6875
# if set, run only the tests passed
6976
SPECIFIC_TESTS=""
@@ -91,7 +98,7 @@ fi
9198
# * `srcdir=..` specifies the GNU source directory for tests (fixing failing/confused 'tests/factor/tNN.sh' tests and causing no harm to other tests)
9299
#shellcheck disable=SC2086
93100

94-
if test "$1" != "run-root"; then
101+
if test "$1" != "run-root" && test "$1" != "run-tty"; then
95102
# run the regular tests
96103
if test $# -ge 1; then
97104
timeout -sKILL 4h "${MAKE}" -j "$("${NPROC}")" check TESTS="$SPECIFIC_TESTS" SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit="" srcdir="${path_GNU}" || : # Kill after 4 hours in case something gets stuck in make

0 commit comments

Comments
 (0)