Skip to content

Commit

Permalink
tests: Add CTest base harness testing
Browse files Browse the repository at this point in the history
Add a testcase to validate the added CTest twister harness.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
  • Loading branch information
pdgendt committed Dec 21, 2024
1 parent fb93c8a commit 77a22a7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/ctest/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2024 Basalte bv
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(ctest_base)

target_sources(app PRIVATE ${ZEPHYR_BASE}/misc/empty_file.c)

enable_testing()
include(CTest)

# A test that always succeeds
add_test(NAME success COMMAND ${CMAKE_COMMAND} -E true)

# A test that is expected to fail
add_test(NAME failure COMMAND ${CMAKE_COMMAND} -E false)
set_property(TEST failure PROPERTY WILL_FAIL true)
1 change: 1 addition & 0 deletions tests/ctest/base/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Intentionally empty
8 changes: 8 additions & 0 deletions tests/ctest/base/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
common:
tags:
- test_framework
integration_platforms:
- native_sim
harness: ctest
tests:
testing.ctest.base: {}

0 comments on commit 77a22a7

Please sign in to comment.