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
f4f25505df1d2ede727071eb0c518368a206f64b #15000
Follow-up to
71cf0d1fca9e1f53524e1545ef0c08d174458d80 #14772
Closes #16750
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()
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
# 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) {
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
server_exe
);
use pathhelp qw(
+ exe_ext
sys_native_current_path
);
use processhelp qw(
$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;
-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
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) {