From 1537ee7a0bf44979d4ed1c27d0d8b961cf4d3f80 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 7 Apr 2022 16:08:34 -0400 Subject: [PATCH] ztest: if runid is set, propagate it define test run id and make it available to ztest. This will be used to verify we are evaluating the same test we have just built and flashed and that we are not looking at some old output. Existing code in ztest will use this, and twister will define the run id. Signed-off-by: Anas Nashif --- subsys/testsuite/ztest/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subsys/testsuite/ztest/CMakeLists.txt b/subsys/testsuite/ztest/CMakeLists.txt index 44ab071fc18..db53296082f 100644 --- a/subsys/testsuite/ztest/CMakeLists.txt +++ b/subsys/testsuite/ztest/CMakeLists.txt @@ -5,6 +5,10 @@ zephyr_include_directories( ${ZEPHYR_BASE}/subsys/testsuite/ztest/include ) +if(DEFINED TC_RUNID) + zephyr_compile_definitions(TC_RUNID=${TC_RUNID}) +endif() + zephyr_library() zephyr_library_sources_ifndef(CONFIG_ZTEST_NEW_API src/ztest.c) zephyr_library_sources_ifdef(CONFIG_ZTEST_NEW_API src/ztest_new.c)