summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-14 17:20:20 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-09-14 17:20:27 (GMT)
commit7c94434351171a30eda1bb97ea15b3fa5ab4c0d2 (patch)
treec0a91491553dbd7eddf5faa41f1961eeedb81473
parentf0c84346ed25f6b8ce3a9f79aece87a58c8a4748 (diff)
parentbdd0e2d7095932730162faebd99bc28152ca0c1c (diff)
downloadCMake-7c94434351171a30eda1bb97ea15b3fa5ab4c0d2.zip
CMake-7c94434351171a30eda1bb97ea15b3fa5ab4c0d2.tar.gz
CMake-7c94434351171a30eda1bb97ea15b3fa5ab4c0d2.tar.bz2
Merge topic 'test-ninja-sub-build-fs-delay'
bdd0e2d709 Tests: Extend RunCMake.Ninja filesystem delays Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2310
-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}")