runtests: auto-detect test bundle builds

If libtests, units and servers binaries are all present, auto-enable
bundle mode.

Drop manual runtests option.

Note: Make sure to "make clean" before changing the test bundle build
setting.

Also fix to append executable extension to all libtest and unit test
executables when launching them. This should make it a tiny bit faster
on Windows.

Follow-up to f4f25505df #15000
Follow-up to 71cf0d1fca #14772

Closes #16750
This commit is contained in:
Viktor Szakats 2025-03-17 18:46:42 +01:00
parent 77861ace49
commit a9b7cbf34f
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
5 changed files with 15 additions and 26 deletions

View File

@ -40,9 +40,6 @@ add_subdirectory(unit)
add_subdirectory(certs EXCLUDE_FROM_ALL)
function(curl_add_runtests _targetname _test_flags)
if(CURL_TEST_BUNDLES)
string(APPEND _test_flags " -bundle")
endif()
if(NOT BUILD_LIBCURL_DOCS)
string(APPEND _test_flags " !documentation")
endif()

View File

@ -123,9 +123,6 @@ if CROSSCOMPILING
TEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
PYTEST = $(TEST)
else # if not cross-compiling:
if USE_TEST_BUNDLES
TEST_COMMON += -bundle
endif
if BUILD_DOCS
else

View File

@ -916,24 +916,20 @@ sub singletest_run {
# Default the tool to a unit test with the same name as the test spec
if($keywords{"unittest"} && !$tool) {
$tool_name="unit$testnum";
$tool = $tool_name;
$tool = $tool_name . exe_ext('TOOL');
}
if($tool =~ /^lib/) {
if($bundle) {
$CMDLINE=$LIBDIR . "libtests";
}
else {
$CMDLINE=$LIBDIR . $tool;
$tool = "libtests" . exe_ext('TOOL');
}
$CMDLINE=$LIBDIR . $tool;
}
elsif($tool =~ /^unit/) {
if($bundle) {
$CMDLINE=$UNITDIR . "units";
}
else {
$CMDLINE=$UNITDIR . $tool;
$tool = "units" . exe_ext('TOOL')
}
$CMDLINE=$UNITDIR . $tool;
}
if(! -f $CMDLINE) {

View File

@ -96,11 +96,6 @@ Provide a path to a curl binary to talk to APIs (currently only CI test APIs).
Display test results in automake style output (`PASS/FAIL: [number] [name]`).
## `-bundle`
Run tests via bundled test binaries. Bundled test binaries contain all tests,
and the test name passed as the first argument selects which test run.
## `-c \<curl\>`
Provide a path to a custom curl binary to run the tests with. Default is the

View File

@ -88,6 +88,7 @@ use serverhelp qw(
server_exe
);
use pathhelp qw(
exe_ext
sys_native_current_path
);
use processhelp qw(
@ -2280,11 +2281,6 @@ while(@ARGV) {
$ACURL=shell_quote($ARGV[1]);
shift @ARGV;
}
elsif ($ARGV[0] eq "-bundle") {
# use test bundles
$bundle=1;
$ENV{'CURL_TEST_BUNDLES'} = 1;
}
elsif ($ARGV[0] eq "-d") {
# have the servers display protocol output
$debugprotocol=1;
@ -2466,7 +2462,6 @@ Usage: runtests.pl [options] [test selection(s)]
-a continue even if a test fails
-ac path use this curl only to talk to APIs (currently only CI test APIs)
-am automake style output PASS/FAIL: [number] [name]
-bundle use test bundles
-c path use this curl executable
-d display server debug info
-e, --test-event event-based execution
@ -2546,6 +2541,15 @@ EOHELP
shift @ARGV;
}
# Detect a test bundle build
if(-e $LIBDIR . "libtests" . exe_ext('TOOL') &&
-e $UNITDIR . "units" . exe_ext('TOOL') &&
-e $SRVDIR . "servers" . exe_ext('SRV')) {
# use test bundles
$bundle=1;
$ENV{'CURL_TEST_BUNDLES'} = 1;
}
delete $ENV{'DEBUGINFOD_URLS'} if($ENV{'DEBUGINFOD_URLS'} && $no_debuginfod);
if(!$randseed) {