mirror of
https://github.com/curl/curl.git
synced 2025-09-20 02:52:48 +03:00
CI/tests: fix invocation of tests for CMake builds
Update appveyor.yml to set env variable TFLAGS and run tests Remove curly braces due to CMake error (${TFLAGS} -> $TFLAGS) Move testdeps build to build step (per review comments) Reviewed-by: Marc Hörsken Closes #6066 Fixes #6052
This commit is contained in:
parent
112418070a
commit
d8fffd718b
12
appveyor.yml
12
appveyor.yml
|
@ -291,11 +291,19 @@ build_script:
|
||||||
if %BUILD_SYSTEM%==autotools (
|
if %BUILD_SYSTEM%==autotools (
|
||||||
bash.exe -e -l -c "cd /c/projects/curl && ./buildconf && ./configure %CONFIG_ARGS% && make && make examples && cd tests && make"
|
bash.exe -e -l -c "cd /c/projects/curl && ./buildconf && ./configure %CONFIG_ARGS% && make && make examples && cd tests && make"
|
||||||
)))))
|
)))))
|
||||||
|
- if %TESTING%==ON (
|
||||||
|
if %BUILD_SYSTEM%==CMake (
|
||||||
|
cmake --build . --config %PRJ_CFG% --parallel 2 --target testdeps
|
||||||
|
))
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- if %TESTING%==ON (
|
- if %TESTING%==ON (
|
||||||
echo APPVEYOR_API_URL=%APPVEYOR_API_URL% &&
|
if %BUILD_SYSTEM%==CMake (
|
||||||
bash.exe -e -l -c "cd /c/projects/curl/tests && ./runtests.pl -a -b$(($(echo '%APPVEYOR_API_URL%' | cut -d'/' -f3 | cut -d':' -f2)+1)) -p !flaky %DISABLED_TESTS%" )
|
set TFLAGS=%DISABLED_TESTS% &&
|
||||||
|
cmake --build . --config %PRJ_CFG% --target test-nonflaky
|
||||||
|
) else (
|
||||||
|
echo APPVEYOR_API_URL=%APPVEYOR_API_URL% &&
|
||||||
|
bash.exe -e -l -c "cd /c/projects/curl/tests && ./runtests.pl -a -b$(($(echo '%APPVEYOR_API_URL%' | cut -d'/' -f3 | cut -d':' -f2)+1)) -p !flaky %DISABLED_TESTS%" ))
|
||||||
|
|
||||||
# select branches to avoid testing feature branches twice (as branch and as pull request)
|
# select branches to avoid testing feature branches twice (as branch and as pull request)
|
||||||
branches:
|
branches:
|
||||||
|
|
|
@ -26,7 +26,7 @@ add_subdirectory(server)
|
||||||
add_subdirectory(unit)
|
add_subdirectory(unit)
|
||||||
|
|
||||||
function(add_runtests targetname test_flags)
|
function(add_runtests targetname test_flags)
|
||||||
# Use a special '${TFLAGS}' placeholder as last argument which will be
|
# Use a special '$TFLAGS' placeholder as last argument which will be
|
||||||
# replaced by the contents of the environment variable in runtests.pl.
|
# replaced by the contents of the environment variable in runtests.pl.
|
||||||
# This is a workaround for CMake's limitation where commands executed by
|
# This is a workaround for CMake's limitation where commands executed by
|
||||||
# 'make' or 'ninja' cannot portably reference environment variables.
|
# 'make' or 'ninja' cannot portably reference environment variables.
|
||||||
|
@ -35,7 +35,7 @@ function(add_runtests targetname test_flags)
|
||||||
COMMAND
|
COMMAND
|
||||||
"${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runtests.pl"
|
"${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runtests.pl"
|
||||||
${test_flags_list}
|
${test_flags_list}
|
||||||
"\${TFLAGS}"
|
"\$TFLAGS"
|
||||||
DEPENDS testdeps
|
DEPENDS testdeps
|
||||||
VERBATIM USES_TERMINAL
|
VERBATIM USES_TERMINAL
|
||||||
)
|
)
|
||||||
|
|
|
@ -5180,9 +5180,9 @@ disabledtests("$TESTDIR/DISABLED.local");
|
||||||
# Check options to this test program
|
# Check options to this test program
|
||||||
#
|
#
|
||||||
|
|
||||||
# Special case for CMake: replace '${TFLAGS}' by the contents of the
|
# Special case for CMake: replace '$TFLAGS' by the contents of the
|
||||||
# environment variable (if any).
|
# environment variable (if any).
|
||||||
if(@ARGV && $ARGV[-1] eq '${TFLAGS}') {
|
if(@ARGV && $ARGV[-1] eq '$TFLAGS') {
|
||||||
pop @ARGV;
|
pop @ARGV;
|
||||||
push(@ARGV, split(' ', $ENV{'TFLAGS'})) if defined($ENV{'TFLAGS'});
|
push(@ARGV, split(' ', $ENV{'TFLAGS'})) if defined($ENV{'TFLAGS'});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user