Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add code coverage for simgrid compilation
[simgrid.git] / buildtools / CPACK / prog_test / CTestConfig.cmake
1 # Configure CTest. For details, see:
2 # http://www.cmake.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest
3
4 #Get the hostname of current machine :
5 find_program(HOSTNAME_CMD NAMES hostname)
6 exec_program(${HOSTNAME_CMD} OUTPUT_VARIABLE HOSTNAME)
7 set(SITE "${HOSTNAME}")
8 MARK_AS_ADVANCED(HOSTNAME_CMD)
9
10 #Get the system information of current machine
11 find_program(UNAME NAMES uname)
12 macro(getuname name flag)
13 exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
14 endmacro(getuname)
15 MARK_AS_ADVANCED(UNAME)
16
17 find_program(CAT NAMES cat)
18 exec_program("${CAT}" ARGS "version" OUTPUT_VARIABLE VERSION)
19
20
21 if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
22   SET(DISTRIB2 "OSX")
23 else(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
24
25   #Try to get the distrib
26   exec_program("${CAT}" ARGS " /etc/issue" OUTPUT_VARIABLE DISTRIB)
27   MARK_AS_ADVANCED(CAT)
28 endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
29
30 STRING(REPLACE " \\n \\l" "" DISTRIB2 ${DISTRIB})
31          
32 getuname(osname -s)
33 getuname(node -n)
34 getuname(osrel  -r)
35 getuname(cpu    -m)
36         
37 SET(BUILDNAME "${osname}_${DISTRIB2}_${cpu}")
38 SET(CTEST_SITE "${node}")
39 SET(CTEST_PROJECT_NAME "${PROJECT_NAME}")
40 SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE "3000000")
41 SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE "3000000")