[cmake] Try to use python3 when available when calling cram
This commit is contained in:
parent
375a21a569
commit
cf63230bf6
1 changed files with 9 additions and 1 deletions
|
@ -46,7 +46,15 @@ if (WIN32)
|
|||
endif ()
|
||||
endif ()
|
||||
|
||||
execute_process (COMMAND python -m cram -v ${CRAM_OPTS} "${CRAM_PATH}" TIMEOUT 60 RESULT_VARIABLE RES)
|
||||
execute_process (COMMAND python3 --version TIMEOUT 1 RESULT_VARIABLE PYTHON3_RES)
|
||||
|
||||
if (NOT PYTHON3_RES STREQUAL "0")
|
||||
set (PYTHON "python")
|
||||
else ()
|
||||
set (PYTHON "python3")
|
||||
endif ()
|
||||
|
||||
execute_process (COMMAND ${PYTHON} -m cram -v ${CRAM_OPTS} "${CRAM_PATH}" TIMEOUT 60 RESULT_VARIABLE RES)
|
||||
|
||||
if (NOT RES STREQUAL "0")
|
||||
message (FATAL_ERROR "Cram tests failed")
|
||||
|
|
Loading…
Add table
Reference in a new issue