build: fix tests when documentation/manual is disabled

- 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
This commit is contained in:
Viktor Szakats 2024-12-09 01:57:32 +01:00
parent 72266a3e9f
commit 2d4852af83
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
7 changed files with 23 additions and 6 deletions

View 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

View 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

View 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.

View 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

View File

@ -3,6 +3,7 @@
<keywords>
source analysis
CURL_VERSION
documentation
</keywords>
</info>

View 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>

View 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>