CMake/Tests/CommandLength/CMakeLists.txt
Brad King edb833d69e Tests/CommandLength: Refactor test commands to reduce test run time
Since 2024-02-09 or so this test frequently times out on a few of our
Windows CI runners. Use fewer but longer command lines to achieve a
similar total command length.  By running fewer commands, the test
takes much less time.
2024-02-15 09:40:13 -05:00

21 lines
578 B
CMake

cmake_minimum_required(VERSION 3.10)
project(CommandLength C)
add_executable(CommandLength test.c)
add_custom_command(TARGET CommandLength POST_BUILD VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory log)
set(msg "xxxx $$$$ yyyy")
set(msg "${msg} ${msg}")
set(msg "${msg} ${msg}")
set(msg "${msg} ${msg}")
set(msg "${msg} ${msg}")
set(msg "${msg} ${msg}")
set(msg "${msg} ${msg}")
set(msg "${msg} ${msg}")
foreach(i RANGE 1 125)
add_custom_command(TARGET CommandLength POST_BUILD VERBATIM
COMMAND ${CMAKE_COMMAND} -E echo "${i} ${msg}" > log/${i}
)
endforeach()