1
add_custom_target(autopilot)
3
option(ENABLE_AUTOPILOT "Enable or Disable autopilot tests" On)
4
option(AUTOPILOT_RECORD "Enable or Disable autopilot record tests" OFF)
5
option(AUTOPILOT_RECORD_PATH "Directory to put recorded tests" OFF)
8
find_program(AUTOPILOT_BIN autopilot)
10
message(STATUS "Autopilot tests enabled.")
12
message(STATUS "Autopilot tests disabled: autopilot binary not found")
16
if(AUTOPILOT_RECORD OR AUTOPILOT_RECORD_PATH)
17
find_program(AUTOPILOT_REC_BIN recordmydesktop)
19
message(STATUS "Record autopilot enabled")
20
if(AUTOPILOT_RECORD_PATH)
21
message(STATUS "Save autopilot tests video in: ${AUTOPILOT_RECORD_PATH}")
22
set(AUTOPILOT_TESTS_ARGS -r -rd ${AUTOPILOT_RECORD_PATH})
24
set(AUTOPILOT_TESTS_ARGS -r)
27
message(STATUS "recordmydesktop necessary for record autopilot tests not found.")
28
set(AUTOPILOT_TESTS_ARGS "")
32
function(declare_autopilot_test ENVIROMENT TEST_NAME WORKING_DIR)
34
add_custom_command(TARGET autopilot
35
COMMAND ${ENVIROMENT} autopilot run ${TEST_NAME} ${AUTOPILOT_TESTS_ARGS}
36
WORKING_DIRECTORY ${WORKING_DIR})