Просмотр исходного кода

Tests: Prevent unnecessary rebuilds in CTestTestMemcheck

Repeated "cmake . && ninja" calls were resulting in rebuilds every time.

Change the test so that it uses "file(WRITE" to generate a ".in" file and
then configure_file to "copy if different" that ".in" file to the final
generated source file.

Now, rebuilds will only occur if there are changes to the generated source
file on "cmake ." runs after the first one.
David Cole 12 лет назад
Родитель
Сommit
84a4230406
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt

+ 6 - 1
Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt

@@ -1,7 +1,12 @@
 # A dummy checker implementation that does not write the requested output file
 # so it triggers an error for every checker.
 
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" "int main(){return 0;}\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(){return 0;}\n")
+
+configure_file(
+  "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/ret0.c"
+  )
 
 foreach(_pseudo IN ITEMS valgrind purify BC)
   add_executable(pseudonl_${_pseudo} "${CMAKE_CURRENT_BINARY_DIR}/ret0.c")