summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-12 14:21:12 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-12 14:22:22 (GMT)
commitbdd0e2d7095932730162faebd99bc28152ca0c1c (patch)
tree138ed0e73b55e275077661bd6fd390b123427de0 /Tests/RunCMake
parent42212f7539040139ecec092547b7d58ef12a4d72 (diff)
downloadCMake-bdd0e2d7095932730162faebd99bc28152ca0c1c.zip
CMake-bdd0e2d7095932730162faebd99bc28152ca0c1c.tar.gz
CMake-bdd0e2d7095932730162faebd99bc28152ca0c1c.tar.bz2
Tests: Extend RunCMake.Ninja filesystem delays
On filesystems with 1s resolution the `run_sub_cmake` cases fail occasionally when the 1 second sleep does not cause files to have a different time. Use 3 seconds instead.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index e0ddc9c..4b366a8 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -205,15 +205,16 @@ function(run_sub_cmake test ninja_output_path_prefix)
set(cmd_prefix "")
set(cmd_suffix "")
endif()
+ set(fs_delay 3) # We assume the system as 1 sec timestamp resolution.
file(WRITE "${top_build_ninja}" "\
subninja ${escaped_ninja_output_path_prefix}/build.ninja
default ${escaped_ninja_output_path_prefix}/all
-# Sleep for 1 second before to regenerate to make sure the timestamp of
+# Sleep for long enough before regenerating to make sure the timestamp of
# the top build.ninja will be strictly greater than the timestamp of the
-# sub/build.ninja file. We assume the system as 1 sec timestamp resolution.
+# sub/build.ninja file.
rule RERUN
- command = ${cmd_prefix}\"${escaped_CMAKE_COMMAND}\" -E sleep 1 && \"${escaped_CMAKE_COMMAND}\" -E touch \"${escaped_top_build_ninja}\"${cmd_suffix}
+ command = ${cmd_prefix}\"${escaped_CMAKE_COMMAND}\" -E sleep ${fs_delay} && \"${escaped_CMAKE_COMMAND}\" -E touch \"${escaped_top_build_ninja}\"${cmd_suffix}
description = Testing regeneration
generator = 1
@@ -239,7 +240,7 @@ build build.ninja: RERUN ${escaped_build_ninja_dep} || ${escaped_ninja_output_pa
# Test regeneration rules run in order.
set(main_cmakelists "${RunCMake_SOURCE_DIR}/CMakeLists.txt")
- sleep(1) # Assume the system as 1 sec timestamp resolution.
+ sleep(${fs_delay})
touch("${main_cmakelists}")
touch("${build_ninja_dep}")
run_ninja("${top_build_dir}")