DIRECTORY-message-lazy-check.cmake 977 B

123456789101112131415161718192021222324
  1. file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/prefix)
  2. execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
  3. OUTPUT_VARIABLE out ERROR_VARIABLE err)
  4. set(expect "
  5. -- Installing: [^\n]*/prefix/dir\r?
  6. -- Installing: [^\n]*/prefix/dir/empty.txt\r?
  7. ")
  8. if(NOT out MATCHES "${expect}")
  9. string(REGEX REPLACE "\n" "\n " out " ${out}")
  10. string(APPEND RunCMake_TEST_FAILED
  11. "First install did not say 'Installing' as expected:\n${out}")
  12. endif()
  13. set(f ${RunCMake_TEST_BINARY_DIR}/prefix/dir/empty.txt)
  14. if(NOT EXISTS "${f}")
  15. string(APPEND RunCMake_TEST_FAILED
  16. "File was not installed:\n ${f}\n")
  17. endif()
  18. execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
  19. OUTPUT_VARIABLE out ERROR_VARIABLE err)
  20. if(out MATCHES "(Installing|Up-to-date)")
  21. string(REGEX REPLACE "\n" "\n " out " ${out}")
  22. string(APPEND RunCMake_TEST_FAILED
  23. "Second install was not silent as expected:\n${out}")
  24. endif()