]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: fix tests when documentation/manual is disabled
authorViktor Szakats <commit@vsz.me>
Mon, 9 Dec 2024 00:57:32 +0000 (01:57 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 9 Dec 2024 11:45:29 +0000 (12:45 +0100)
- build: fix to exclude 'documentation' tests when building
  the documentation is explicitly disabled. Both for cmake
  and `./configure`.

Reported-by: Daniel Engberg
  Fixes #15703

- test481, test482: fix for builds with no manual.

Reported-by: Daniel Engberg
  Fixes #15703

- configure: fix to always detect Perl. Running tests require
  it when run. Before this patch Perl wasn't detected when
  documentation/manual/embedded-CA were all disabled,
  making tests fail to start.

- test1177: add keyword `documentation`. It depends no
  `curl_version_info.3`.

- GHA/linux: test cmake and `./configure` with docs and
  manual disabled and tests run.

Closes #15704

.github/workflows/linux.yml
configure.ac
tests/CMakeLists.txt
tests/Makefile.am
tests/data/test1177
tests/data/test481
tests/data/test482

index a169a0f747c02486a6d1da8dbef9d4b705ac6fa4..ee06e069eb069b9a024394cabc2e7ef3184fc190 100644 (file)
@@ -119,7 +119,7 @@ jobs:
 
           - name: mbedtls-pkg
             install_packages: libnghttp2-dev libmbedtls-dev
-            generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON
+            generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF
 
           - name: mbedtls-pkg !pc
             install_packages: libnghttp2-dev libmbedtls-dev
@@ -167,7 +167,7 @@ jobs:
 
           - name: openssl clang krb5
             install_packages: zlib1g-dev libkrb5-dev clang
-            configure: CC=clang --with-openssl --with-gssapi --enable-debug
+            configure: CC=clang --with-openssl --with-gssapi --enable-debug --disable-docs --disable-manual
 
           - name: openssl clang krb5
             install_packages: zlib1g-dev libkrb5-dev clang
index fa6c6198a24cebca967b53e835ddc5ef8cf747e5..e3ecf00c6188a54633487d1a025ebe988e3c26c9 100644 (file)
@@ -4215,11 +4215,11 @@ fi
 
 CURL_CHECK_NONBLOCKING_SOCKET
 
-if test "x$BUILD_DOCS" != "x0" -o "x$USE_MANUAL" != "x0" -o "x$CURL_CA_EMBED" != "x"; then
-  AC_PATH_PROG(PERL, perl,,
-    $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin)
-  AC_SUBST(PERL)
+AC_PATH_PROG(PERL, perl,,
+  $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin)
+AC_SUBST(PERL)
 
+if test "x$BUILD_DOCS" != "x0" -o "x$USE_MANUAL" != "x0" -o "x$CURL_CA_EMBED" != "x"; then
   if test -z "$PERL"; then
     AC_MSG_ERROR([perl was not found, needed for docs, manual and CA embed])
   fi
index 165b49dfefcab44b117e5003bb625b34d10205cf..0e40b2e19243a36a4d562dc51cb3b8c6a4d3c801 100644 (file)
@@ -43,6 +43,9 @@ function(add_runtests _targetname _test_flags)
   if(CURL_TEST_BUNDLES)
     set(_test_flags "${_test_flags} -bundle")
   endif()
+  if(NOT BUILD_LIBCURL_DOCS)
+    set(_test_flags "${_test_flags} !documentation")
+  endif()
   # Skip walking through dependent targets before running tests in CI.
   # This avoids: GNU Make doing a slow re-evaluation of all targets and
   # skipping them, MSBuild doing a re-evaluation, and actually rebuilding them.
index 56329f4a8aae96d32b62ef1ed8ba2f21faf4ea2e..46d58fed8552b5e575bd9c39fa0f503c8b38a1ab 100644 (file)
@@ -128,6 +128,11 @@ if USE_TEST_BUNDLES
 TEST_COMMON += -bundle
 endif
 
+if BUILD_DOCS
+else
+TEST_COMMON += !documentation
+endif
+
 TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl $(TEST_COMMON)
 TEST_Q = -a -s
 TEST_AM = -a -am
index 6cc94a5b1d3b5e589fe76d2f1244a71895366aa5..c1f6d661c81fc17c93b9881e7d745c588fce0b09 100644 (file)
@@ -3,6 +3,7 @@
 <keywords>
 source analysis
 CURL_VERSION
+documentation
 </keywords>
 </info>
 
index f59fec2f9f9b8b06989e8d0975e577bfc1d784d6..33e7734bcf072b5b48a98be8dbeac6cf336c9701 100644 (file)
@@ -39,7 +39,11 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --no-clobber -C 1 -o "%LOGDIR/%TESTNUMBER"
 <stderr mode="text">
 curl: --continue-at is mutually exclusive with --no-clobber
 curl: option -C: is badly used here
+%if manual
 curl: try 'curl --help' or 'curl --manual' for more information
+%else
+curl: try 'curl --help' for more information
+%endif
 </stderr>
 </verify>
 </testcase>
index ce7f8f2b4195a95d9408add44c92697b67155cc9..9b34ca9c4ba95d229be567aa17636bc8246ca98f 100644 (file)
@@ -35,7 +35,11 @@ http://non-existing-host.haxx.se. --remove-on-error -C 1 -o "%LOGDIR/%TESTNUMBER
 <stderr mode="text">
 curl: --continue-at is mutually exclusive with --remove-on-error
 curl: option -C: is badly used here
+%if manual
 curl: try 'curl --help' or 'curl --manual' for more information
+%else
+curl: try 'curl --help' for more information
+%endif
 </stderr>
 </verify>
 </testcase>