From: Viktor Szakats Date: Thu, 27 Feb 2025 01:38:07 +0000 (+0100) Subject: runtests: accept `CURL_DIRSUFFIX` without ending slash X-Git-Tag: curl-8_13_0~328 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cba83bfb10c294510505125be920b60667113509;p=thirdparty%2Fcurl.git runtests: accept `CURL_DIRSUFFIX` without ending slash Follow-up to 3585796049aa5c8cc2ef4e4fa3ac289b0d5ed85c #16452 Closes #16506 --- diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c781b740ae..4a379fb29f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -907,7 +907,7 @@ jobs: if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} timeout-minutes: 10 run: | - export CURL_DIRSUFFIX='${{ matrix.type }}/' + export CURL_DIRSUFFIX='${{ matrix.type }}' export TFLAGS='-j8 ~WebSockets ~SCP ~612 ${{ matrix.tflags }}' if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then TFLAGS+=' ~SFTP' diff --git a/appveyor.sh b/appveyor.sh index b587022154..efe870a7fc 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -147,7 +147,7 @@ fi if [ "${TFLAGS}" != 'skipall' ] && \ [ "${TFLAGS}" != 'skiprun' ]; then - export CURL_DIRSUFFIX="${PRJ_CFG}/" + export CURL_DIRSUFFIX="${PRJ_CFG}" if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" elif [ -x "$(cygpath 'C:/msys64/usr/bin/curl.exe')" ]; then diff --git a/tests/globalconfig.pm b/tests/globalconfig.pm index 70ded3f2bf..c9384673de 100644 --- a/tests/globalconfig.pm +++ b/tests/globalconfig.pm @@ -73,7 +73,10 @@ BEGIN { $dev_null ); } -use pathhelp qw(exe_ext); +use pathhelp qw( + exe_ext + dirsepadd +); use Cwd qw(getcwd); use testutil qw( shell_quote @@ -104,11 +107,11 @@ our $perlcmd=shell_quote($^X); our $perl="$perlcmd -I. " . shell_quote("-I$srcdir"); # invoke perl like this our $LOGDIR="log"; # root of the log directory; this will be different for # each runner in multiprocess mode -our $LIBDIR="./libtest/" . ($ENV{'CURL_DIRSUFFIX'} || ''); -our $UNITDIR="./unit/" . ($ENV{'CURL_DIRSUFFIX'} || ''); -our $SRVDIR="./server/" . ($ENV{'CURL_DIRSUFFIX'} || ''); +our $LIBDIR=dirsepadd("./libtest/" . ($ENV{'CURL_DIRSUFFIX'} || '')); +our $UNITDIR=dirsepadd("./unit/" . ($ENV{'CURL_DIRSUFFIX'} || '')); +our $SRVDIR=dirsepadd("./server/" . ($ENV{'CURL_DIRSUFFIX'} || '')); our $TESTDIR="$srcdir/data"; -our $CURL="../src/" . ($ENV{'CURL_DIRSUFFIX'} || '') . "curl".exe_ext('TOOL'); # what curl binary to run on the tests +our $CURL=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) . "curl".exe_ext('TOOL'); # what curl binary to run on the tests our $VCURL=$CURL; # what curl binary to use to verify the servers with # VCURL is handy to set to the system one when the one you # just built hangs or crashes and thus prevent verification diff --git a/tests/pathhelp.pm b/tests/pathhelp.pm index 6b721be1f1..963552770c 100644 --- a/tests/pathhelp.pm +++ b/tests/pathhelp.pm @@ -59,6 +59,7 @@ BEGIN { our @EXPORT_OK = qw( os_is_win exe_ext + dirsepadd sys_native_abs_path sys_native_current_path build_sys_abs_path @@ -182,4 +183,13 @@ sub exe_ext { return ''; } +#*************************************************************************** +# Add ending slash if missing +# +sub dirsepadd { + my ($dir) = @_; + $dir =~ s/\/$//; + return $dir . '/'; +} + 1; # End of module