ValidateBuild.cmake.in 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #
  2. # This code validates that the Trilinos build was "successful enough" (since it
  3. # is difficult to detect this from the caller of the experimental_build_test
  4. # dashboard script...)
  5. #
  6. set(binary_dir "@binary_dir@")
  7. message("binary_dir='${binary_dir}'")
  8. # Count *.exe files:
  9. #
  10. file(GLOB_RECURSE exes "${binary_dir}/*.exe")
  11. message(STATUS "exes='${exes}'")
  12. list(LENGTH exes len)
  13. if(len LESS 47)
  14. message(FATAL_ERROR "len='${len}' is less than minimum expected='47' (count of executables)")
  15. endif()
  16. message(STATUS "Found len='${len}' *.exe files")
  17. # Try to find the Teuchos unit tests executable:
  18. #
  19. file(GLOB_RECURSE exe "${binary_dir}/TeuchosCore_UnitTest_UnitTests.exe")
  20. list(LENGTH exe len)
  21. if(NOT len EQUAL 1)
  22. message(FATAL_ERROR "len='${len}' is not the expected='1' (count of TeuchosCore_UnitTest_UnitTests.exe)")
  23. endif()
  24. message(STATUS "Found exe='${exe}'")
  25. # Try to run it:
  26. execute_process(COMMAND ${exe} RESULT_VARIABLE rv)
  27. if(NOT "${rv}" STREQUAL "0")
  28. message(FATAL_ERROR "rv='${rv}' is not the expected='0' (result of running TeuchosCore_UnitTest_UnitTests.exe)")
  29. endif()
  30. message(STATUS "Ran exe='${exe}' rv='${rv}'")
  31. message(STATUS "All Trilinos build validation tests pass.")