From 7d0cb000e818b3fc9c60cd93ac02efc48e54628f Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 5 Sep 2026 14:15:57 -0400 Subject: [PATCH] Specify `COLUMNS` in test scripts for consistent output --- test/asm/test.sh | 4 ++++ test/fix/test.sh | 4 ++++ test/gfx/test.sh | 6 ++++++ test/link/test.sh | 7 ++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/test/asm/test.sh b/test/asm/test.sh index 9d03bb31..7b6b58d1 100755 --- a/test/asm/test.sh +++ b/test/asm/test.sh @@ -2,6 +2,10 @@ export LC_ALL=C +# Screen width for help/usage text (for reproducible test results) +export COLUMNS=79 +shopt -u checkwinsize # Prevent subsequent commands from resetting `COLUMNS` + # Game Boy release date, 1989-04-21T12:34:56Z (for reproducible test results) export SOURCE_DATE_EPOCH=609165296 diff --git a/test/fix/test.sh b/test/fix/test.sh index f18ef905..7c48a24d 100755 --- a/test/fix/test.sh +++ b/test/fix/test.sh @@ -2,6 +2,10 @@ export LC_ALL=C +# Screen width for help/usage text (for reproducible test results) +export COLUMNS=79 +shopt -u checkwinsize # Prevent subsequent commands from resetting `COLUMNS` + tmpdir="$(mktemp -d)" # shellcheck disable=SC2064 # (Immediate expansion is the desired behavior.) trap "cd; rm -rf ${tmpdir@Q}" EXIT diff --git a/test/gfx/test.sh b/test/gfx/test.sh index f3cc5f09..ae608ad4 100755 --- a/test/gfx/test.sh +++ b/test/gfx/test.sh @@ -3,6 +3,12 @@ [[ -e ./rgbgfx_test ]] || make -C ../.. test/gfx/rgbgfx_test Q= ${CXX:+"CXX=$CXX"} || exit [[ -e ./randtilegen ]] || make -C ../.. test/gfx/randtilegen Q= ${CXX:+"CXX=$CXX"} || exit +export LC_ALL=C + +# Screen width for help/usage text (for reproducible test results) +export COLUMNS=79 +shopt -u checkwinsize # Prevent subsequent commands from resetting `COLUMNS` + errtmp="$(mktemp)" # shellcheck disable=SC2064 # (Immediate expansion is the desired behavior.) diff --git a/test/link/test.sh b/test/link/test.sh index fe1cb17b..73c13ab3 100755 --- a/test/link/test.sh +++ b/test/link/test.sh @@ -1,8 +1,13 @@ #!/usr/bin/env bash -export LC_ALL=C set -o pipefail +export LC_ALL=C + +# Screen width for help/usage text (for reproducible test results) +export COLUMNS=79 +shopt -u checkwinsize # Prevent subsequent commands from resetting `COLUMNS` + otemp="$(mktemp)" gbtemp="$(mktemp)" gbtemp2="$(mktemp)"