Debian Codegraph @

Tests/Contracts/Trilinos/ValidateBuild.cmake.in

raw
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
9
10 # Count *.exe files:
11 #
12 file(GLOB_RECURSE exes "${binary_dir}/*.exe")
13 message(STATUS "exes='${exes}'")
14 list(LENGTH exes len)
15 if(len LESS 47)
16 message(FATAL_ERROR "len='${len}' is less than minimum expected='47' (count of executables)")
17 endif()
18 message(STATUS "Found len='${len}' *.exe files")
19
20
21 # Try to find the Teuchos unit tests executable:
22 #
23 file(GLOB_RECURSE exe "${binary_dir}/TeuchosCore_UnitTest_UnitTests.exe")
24 list(LENGTH exe len)
25 if(NOT len EQUAL 1)
26 message(FATAL_ERROR "len='${len}' is not the expected='1' (count of TeuchosCore_UnitTest_UnitTests.exe)")
27 endif()
28 message(STATUS "Found exe='${exe}'")
29
30
31 # Try to run it:
32 execute_process(COMMAND ${exe} RESULT_VARIABLE rv)
33 if(NOT "${rv}" STREQUAL "0")
34 message(FATAL_ERROR "rv='${rv}' is not the expected='0' (result of running TeuchosCore_UnitTest_UnitTests.exe)")
35 endif()
36 message(STATUS "Ran exe='${exe}' rv='${rv}'")
37
38
39 message(STATUS "All Trilinos build validation tests pass.")