DIRECTORY-message-check.cmake 1.0 KB

12345678910111213141516171819202122232425262728
  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. set(expect "
  21. -- Up-to-date: [^\n]*/prefix/dir\r?
  22. -- Up-to-date: [^\n]*/prefix/dir/empty.txt\r?
  23. ")
  24. if(NOT out MATCHES "${expect}")
  25. string(REGEX REPLACE "\n" "\n " out " ${out}")
  26. string(APPEND RunCMake_TEST_FAILED
  27. "Second install did not say 'Up-to-date' as expected:\n${out}")
  28. endif()