West: Add west robot command

Introduce `robot` command for running Robot Framework test suites.
Initial implementation consists of one runner dedicated for renode-test,
which is a Renode wrapper for running Robot tests.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
This commit is contained in:
Michał Szprejda 2024-03-07 10:35:06 +01:00 committed by Alberto Escolar
commit 7c084b6649
12 changed files with 168 additions and 4 deletions

View file

@ -0,0 +1,17 @@
# SPDX-License-Identifier: Apache-2.0
board_set_robot_runner_ifnset(renode-robot)
# `--variable` is a renode-test argument, for setting a variable that can be later used in a .robot file:
# ELF: used in common.robot to set the `elf` variable in the default .resc script defined in board.cmake
# RESC: path to the .resc script, defined in board.cmake
# UART: default UART used by Robot in tests, defined in board.cmake
# KEYWORDS: path to common.robot, which contains common Robot keywords
# RESULTS_DIR: directory in which Robot artifacts will be generated after running a testsuite
board_runner_args(renode-robot "--renode-robot-arg=--variable=ELF:@${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME}")
board_runner_args(renode-robot "--renode-robot-arg=--variable=RESC:@${RENODE_SCRIPT}")
board_runner_args(renode-robot "--renode-robot-arg=--variable=UART:${RENODE_UART}")
board_runner_args(renode-robot "--renode-robot-arg=--variable=KEYWORDS:${ZEPHYR_BASE}/tests/robot/common.robot")
board_runner_args(renode-robot "--renode-robot-arg=--variable=RESULTS_DIR:${APPLICATION_BINARY_DIR}")
board_finalize_runner_args(renode-robot)

View file

@ -5,4 +5,6 @@ set(RENODE_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/support/m2gl025_miv.resc)
set(RENODE_UART sysbus.uart)
set_ifndef(BOARD_SIM_RUNNER renode)
set_ifndef(BOARD_ROBOT_RUNNER renode-robot)
include(${ZEPHYR_BASE}/boards/common/renode.board.cmake)
include(${ZEPHYR_BASE}/boards/common/renode_robot.board.cmake)

View file

@ -30,4 +30,6 @@ elseif("${BOARD_REVISION}" STREQUAL "B")
endif()
set_ifndef(BOARD_SIM_RUNNER renode)
set_ifndef(BOARD_ROBOT_RUNNER renode-robot)
include(${ZEPHYR_BASE}/boards/common/renode.board.cmake)
include(${ZEPHYR_BASE}/boards/common/renode_robot.board.cmake)