From b6bed508f5202e01018615dce96dac06fcd8784b Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Tue, 1 Jul 2025 07:57:59 -0400 Subject: [PATCH] build: Set OS_WINDOWS in `scripts/defines.sh` to aid with Windows detection in test cases This uses the result AC_CANONICAL_HOST and a pre-existing case statement checking for mingw32, cygwin, interix to determine if the build system is Windows based... We make the not unreasonable assumption that if the build system is Windows based, the tests will also be running on a Windows system. --- configure.ac | 19 ++++++++++++++++--- tests/run.in | 3 +++ tests/scripts/defines.sh | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index a506cb1e7f..60c53bb01e 100644 --- a/configure.ac +++ b/configure.ac @@ -703,10 +703,23 @@ OL_MSVC dnl ---------------------------------------------------------------- dnl Checks for Windows NT case $host_os in - *mingw32* ) ac_cv_mingw32=yes ;; - *cygwin* ) ac_cv_cygwin=yes ;; - *interix* ) ac_cv_interix=yes ;; + *mingw32* ) + ac_cv_mingw32=yes + OS_WINDOWS=yes + ;; + *cygwin* ) + ac_cv_cygwin=yes + OS_WINDOWS=yes + ;; + *interix* ) + ac_cv_interix=yes + OS_WINDOWS=yes + ;; + * ) + OS_WINDOWS=no + ;; esac +AC_SUBST([OS_WINDOWS]) AC_CHECK_TOOL(RC, windres, ) diff --git a/tests/run.in b/tests/run.in index c30fc7c4fb..4bcc7af03f 100644 --- a/tests/run.in +++ b/tests/run.in @@ -46,6 +46,9 @@ AC_WITH_MODULES_ENABLED=@WITH_MODULES_ENABLED@ AC_ACI_ENABLED=aci@WITH_ACI_ENABLED@ AC_LIBS_DYNAMIC=lib@BUILD_LIBS_DYNAMIC@ +# environment +AC_OS_WINDOWS=@OS_WINDOWS@ + export AC_lloadd \ AC_WITH_SASL AC_WITH_TLS AC_WITH_MODULES_ENABLED AC_ACI_ENABLED \ AC_LIBS_DYNAMIC AC_WITH_TLS AC_TLS_TYPE diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index d69ac86835..5a97fe3472 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -78,6 +78,8 @@ SLEEP1=${SLEEP1-7} SLEEP2=${SLEEP2-15} TIMEOUT=${TIMEOUT-8} +OS_WINDOWS=${AC_OS_WINDOWS-no} + # dirs PROGDIR="$OBJDIR/tests/progs" DATADIR=${USER_DATADIR-./testdata} -- 2.47.3