diff options
author | Brad King <brad.king@kitware.com> | 2022-02-10 14:14:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-10 14:20:13 (GMT) |
commit | d267602944583d75915b1de50bee410fdaa4dbc0 (patch) | |
tree | 483c6fde88ec53cd5d2729bee7e9331e69f789cc | |
parent | 663296ab4f588ddf082f84a4f02baf894df32152 (diff) | |
download | CMake-d267602944583d75915b1de50bee410fdaa4dbc0.zip CMake-d267602944583d75915b1de50bee410fdaa4dbc0.tar.gz CMake-d267602944583d75915b1de50bee410fdaa4dbc0.tar.bz2 |
Tests: Improve RunCMake.ExternalProject rebuild case robustness
The `CONFIGURE_HANDLED_BY_BUILD` case occasionally fails on builds with
the `Borland Makefiles` generator due to the `make` tool's 1s file
timestamp resolution. Somehow the 1.125s delay is not enough. Several
other tests use a 3s delay for Borland tools for the same reason.
-rw-r--r-- | Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake b/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake index 6dbf0f4..d531928 100644 --- a/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake +++ b/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake @@ -1,5 +1,12 @@ include(ExternalProject) +if(CMAKE_GENERATOR STREQUAL "Borland Makefiles" OR + CMAKE_GENERATOR STREQUAL "Watcom WMake") + set(fs_delay 3) +else() + set(fs_delay 1.125) +endif() + # Given this setup, on the first build, both configure steps and both build # steps will run. On a noop rebuild, only the build steps will run. Without # CONFIGURE_HANDLED_BY_BUILD, the configure step of proj2 would also run on a @@ -11,7 +18,7 @@ ExternalProject_Add(proj1 CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "Doing something" # file(TIMESTAMP) gives back the timestamp in seconds so we sleep a second to # make sure we get a different timestamp on the stamp file - BUILD_COMMAND ${CMAKE_COMMAND} -E sleep 1.125 + BUILD_COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay} INSTALL_COMMAND "" BUILD_ALWAYS ON STAMP_DIR "stamp" @@ -20,7 +27,7 @@ ExternalProject_Add(proj2 DOWNLOAD_COMMAND "" SOURCE_DIR "" CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "Doing something" - BUILD_COMMAND ${CMAKE_COMMAND} -E sleep 1.125 + BUILD_COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay} INSTALL_COMMAND "" CONFIGURE_HANDLED_BY_BUILD ON DEPENDS proj1 |