mirror of
https://github.com/curl/curl.git
synced 2026-08-05 08:16:17 +03:00
tests: fixup tunit tests for cmake
Follow-up to 461ebbd336 #16983
Closes #17051
This commit is contained in:
parent
e86542038d
commit
1d0e19a64d
6 changed files with 19 additions and 17 deletions
|
|
@ -34,6 +34,7 @@ add_subdirectory(http)
|
|||
add_subdirectory(http/clients)
|
||||
add_subdirectory(server)
|
||||
add_subdirectory(libtest)
|
||||
add_subdirectory(tunit)
|
||||
add_subdirectory(unit)
|
||||
add_subdirectory(certs)
|
||||
|
||||
|
|
|
|||
|
|
@ -924,18 +924,18 @@ sub singletest_run {
|
|||
}
|
||||
$CMDLINE=$LIBDIR . $tool;
|
||||
}
|
||||
elsif($tool =~ /^tool/) {
|
||||
if($bundle) {
|
||||
$tool = "tunits" . exe_ext('TOOL')
|
||||
}
|
||||
$CMDLINE=$TUNITDIR . $tool;
|
||||
}
|
||||
elsif($tool =~ /^unit/) {
|
||||
if($bundle) {
|
||||
$tool = "units" . exe_ext('TOOL')
|
||||
}
|
||||
$CMDLINE=$UNITDIR . $tool;
|
||||
}
|
||||
elsif($tool =~ /^tool/) {
|
||||
if($bundle) {
|
||||
$tool = "units" . exe_ext('TOOL')
|
||||
}
|
||||
$CMDLINE=$TUNITDIR . $tool;
|
||||
}
|
||||
|
||||
if(! -f $CMDLINE) {
|
||||
logmsg " $testnum: IGNORED: The tool set in the test case for this: '$tool' does not exist\n";
|
||||
|
|
|
|||
|
|
@ -2518,7 +2518,7 @@ EOHELP
|
|||
}
|
||||
|
||||
# Detect a test bundle build.
|
||||
# Do not look for 'units' because not all configurations build it.
|
||||
# Do not look for 'tunits' and 'units' because not all configurations build them.
|
||||
if(-e $LIBDIR . "libtests" . exe_ext('TOOL') &&
|
||||
-e $SRVDIR . "servers" . exe_ext('SRV')) {
|
||||
# use test bundles
|
||||
|
|
|
|||
2
tests/tunit/.gitignore
vendored
2
tests/tunit/.gitignore
vendored
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
/tool[0-9][0-9][0-9][0-9]
|
||||
tool_bundle.c
|
||||
units
|
||||
tunits
|
||||
|
|
|
|||
|
|
@ -22,24 +22,24 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
# Get 'TOOLPROGS', '*_SOURCES', 'FIRSTFILES' variables
|
||||
# Get 'TOOLPROGS', '*_SOURCES', 'TOOLFILES' variables
|
||||
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
|
||||
if(CURL_TEST_BUNDLES)
|
||||
add_custom_command(
|
||||
OUTPUT "tool_bundle.c"
|
||||
COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "unit_bundle.c"
|
||||
COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "tool_bundle.c"
|
||||
DEPENDS
|
||||
"${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" ${FIRSTFILES}
|
||||
"${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" ${TOOLFILES}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc"
|
||||
VERBATIM)
|
||||
|
||||
set(TOOLPROGS "units")
|
||||
set(units_SOURCES "tool_bundle.c")
|
||||
set(TOOLPROGS "tunits")
|
||||
set(tunits_SOURCES "tool_bundle.c")
|
||||
endif()
|
||||
|
||||
foreach(_target IN LISTS UNITPROGS)
|
||||
foreach(_target IN LISTS TOOLPROGS)
|
||||
set(_target_name "${_target}")
|
||||
add_executable(${_target_name} EXCLUDE_FROM_ALL ${${_target}_SOURCES})
|
||||
add_dependencies(testdeps ${_target_name})
|
||||
|
|
@ -49,6 +49,7 @@ foreach(_target IN LISTS UNITPROGS)
|
|||
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
|
||||
"${PROJECT_SOURCE_DIR}/src"
|
||||
"${PROJECT_SOURCE_DIR}/tests/libtest"
|
||||
"${PROJECT_SOURCE_DIR}/tests/unit" # for curlcheck.h
|
||||
)
|
||||
set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
|
||||
if(CURL_TEST_BUNDLES)
|
||||
|
|
@ -56,5 +57,5 @@ foreach(_target IN LISTS UNITPROGS)
|
|||
endif()
|
||||
set_target_properties(${_target_name} PROPERTIES
|
||||
OUTPUT_NAME "${_target}"
|
||||
PROJECT_LABEL "Test unit ${_target}")
|
||||
PROJECT_LABEL "Test tunit ${_target}")
|
||||
endforeach()
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ if USE_TEST_BUNDLES
|
|||
tool_bundle.c: $(top_srcdir)/tests/mk-bundle.pl Makefile.inc
|
||||
@PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > tool_bundle.c
|
||||
|
||||
noinst_PROGRAMS = units
|
||||
nodist_units_SOURCES = tool_bundle.c
|
||||
noinst_PROGRAMS = tunits
|
||||
nodist_tunits_SOURCES = tool_bundle.c
|
||||
CLEANFILES = tool_bundle.c
|
||||
else
|
||||
# Makefile.inc provides neat definitions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue