testing: add zephyr/ prefix to testing include path

Continuation of issue #41543 to add prefix scope for Zephyr's include
files.

Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
Yuval Peress 2022-04-19 11:54:42 -06:00 committed by Anas Nashif
commit a7ceba3710
38 changed files with 25 additions and 17 deletions

View file

@ -33,6 +33,7 @@ gen_kobj(KOBJ_GEN_DIR)
list(APPEND INCLUDE
subsys/testsuite/ztest/include/zephyr
subsys/testsuite/include/zephyr
subsys/testsuite/ztest/include
subsys/testsuite/include
include/zephyr
@ -63,7 +64,7 @@ target_compile_options(testbinary PRIVATE
)
target_link_options(testbinary PRIVATE
-T "${ZEPHYR_BASE}/subsys/testsuite/include/ztest_unittest.ld"
-T "${ZEPHYR_BASE}/subsys/testsuite/include/zephyr/ztest_unittest.ld"
)
target_link_libraries(testbinary PRIVATE

View file

@ -2,9 +2,11 @@
add_subdirectory_ifdef(CONFIG_ZTEST ztest)
zephyr_include_directories_ifdef(CONFIG_TEST
${ZEPHYR_BASE}/subsys/testsuite/include
)
if(CONFIG_TEST)
zephyr_include_directories(${ZEPHYR_BASE}/subsys/testsuite/include)
zephyr_include_directories_ifdef(
CONFIG_LEGACY_INCLUDE_PATH ${ZEPHYR_BASE}/subsys/testsuite/include/zephyr)
endif()
add_subdirectory_ifdef(CONFIG_COVERAGE_GCOV coverage)
zephyr_library_sources_ifdef(CONFIG_TEST_BUSY_SIM busy_sim/busy_sim.c)

View file

@ -4,6 +4,10 @@ zephyr_include_directories(
${ZEPHYR_BASE}/subsys/testsuite/include
${ZEPHYR_BASE}/subsys/testsuite/ztest/include
)
zephyr_include_directories_ifdef(
CONFIG_LEGACY_INCLUDE_PATH ${ZEPHYR_BASE}/subsys/testsuite/include/zephyr)
zephyr_include_directories_ifdef(
CONFIG_LEGACY_INCLUDE_PATH ${ZEPHYR_BASE}/subsys/testsuite/ztest/include/zephyr)
if(DEFINED TC_RUNID)
zephyr_compile_definitions(TC_RUNID=${TC_RUNID})

View file

@ -4,8 +4,10 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <stdio.h>
#include <zephyr/ztest.h>
#include <zephyr/app_memory/app_memdomain.h>
#ifdef CONFIG_USERSPACE
#include <zephyr/sys/libc-hooks.h>

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <zephyr/types.h>
#include <zephyr/ztest.h>
#include <string.h>
#include <stdio.h>

View file

@ -23,10 +23,9 @@
*/
#include <string.h>
#include <zephyr/types.h>
#include <stdbool.h>
#include <ztest.h>
#include <zephyr/sys/base64.h>
#include <zephyr/ztest.h>
#include "../../../lib/os/base64.c"

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <zephyr/ztest.h>
/**
* @brief A stub unit test.

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <zephyr/ztest.h>
ZTEST_SUITE(framework_tests, NULL, NULL, NULL, NULL, NULL);

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <zephyr/ztest.h>
static void test_empty_test(void)
{

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <busy_sim.h>
#include <zephyr/ztest.h>
#include <zephyr/busy_sim.h>
static void test_busy_sim(void)
{

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <zephyr/ztest.h>
static void test_assert_pass(void)
{

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <zephyr/ztest.h>
static void expect_one_parameter(int a)
{

View file

@ -3,8 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
#include <fff.h>
#include <zephyr/ztest.h>
#include <zephyr/fff.h>
#include <c_test_framework.h>