| # Copyright 2024 Googl4 LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # Support for building cheriot-rtos functional tests | |
| CHERIOT_TEST_DIR := $(OUT)/cheriot/test-suite | |
| CHERIOT_TEST := $(CHERIOT_TEST_DIR)/release/cheriot/cheriot/release/test-suite | |
| ## Runs the cheriot-rtos testbench in renode | |
| cheriot-testbench: renode cheriot_sim cheriot-test | |
| ${MAKE} \ | |
| __CHERIOT_ELF="@${CHERIOT_TEST}" \ | |
| __cheriot-simulate | |
| ## Version of the `cheriot-testbench` target that also enables the simulator command | |
| ## line interface on port 4567. To access the simulator use something like | |
| ## telnet localhost 4567. Note renode will block until the cli is connected. | |
| cheriot-testbench+cli: renode cheriot_sim cheriot-test | |
| ${MAKE} \ | |
| __CHERIOT_ELF="@${CHERIOT_TEST}" \ | |
| __cheriot-simulate+cli | |
| ## Generates the cheriot-rtos test-suite firmware | |
| cheriot-test: | |
| ${MAKE} \ | |
| CHERIOT_BOARD=sail \ | |
| CHERIOT_OUT_DIR="${OUT}/cheriot/test-suite" \ | |
| CHERIOT_FIRMWARE_SRC_DIR=${CHERIOT_SRC_DIR}/tests \ | |
| CHERIOT_FIRMWARE_RELEASE=$(CHERIOT_TEST) \ | |
| $(CHERIOT_TEST) | |
| ## Cleans all build artifacts for the cheriot-rtos test suite | |
| cheriot-test-clean: | |
| rm -rf ${CHERIOT_TEST_DIR} | |
| .PHONY:: cheriot-test cheriot-test-clean |