]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: accept `CURL_DIRSUFFIX` without ending slash
authorViktor Szakats <commit@vsz.me>
Thu, 27 Feb 2025 01:38:07 +0000 (02:38 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 27 Feb 2025 11:11:23 +0000 (12:11 +0100)
Follow-up to 3585796049aa5c8cc2ef4e4fa3ac289b0d5ed85c #16452
Closes #16506

.github/workflows/windows.yml
appveyor.sh
tests/globalconfig.pm
tests/pathhelp.pm

index c781b740ae2ea8b33d5d5d38c472260b2371d4a8..4a379fb29f6909daacd01c654495031d37ec1e38 100644 (file)
@@ -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'
index b58702215497ab811913b258d3705da4ae8bc17e..efe870a7fc8fdf8467af95a16424a32a99a8201f 100644 (file)
@@ -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
index 70ded3f2bfb67b062b772f66b9a0fc9591a80952..c9384673de3ecb88afbf06cd27648c9bbdda6819 100644 (file)
@@ -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
index 6b721be1f14bd1fb88a0109237089a55d012606d..963552770ce0495d7763f9e46bda99d4270c7e53 100644 (file)
@@ -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