Skip to content

Commit 7f90587

Browse files
Yuval Peressnashif
authored andcommitted
test: settings: functional: fix missing test_main
The functional tests for settings subsystem regressed with the introduction of the weak test_main function. This was caused by Issue #19582 since the common code was being linked as a library. Update the logic of the common code to directly add the sources to the `app` target. This resolved both Issue #19582 and #42396 Signed-off-by: Yuval Peress <[email protected]>
1 parent 7b1a56f commit 7f90587

File tree

16 files changed

+6
-78
lines changed

16 files changed

+6
-78
lines changed

tests/subsys/settings/fcb/raw/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
55
project(settings_fcb_raw)
66

77
add_subdirectory(../src fcb_test_bindir)
8-
target_link_libraries(app PRIVATE settings_fcb_test)
9-
10-
# The code is in the library common to several tests.
11-
target_sources(app PRIVATE placeholder.c)
128

139
if(TEST)
1410
target_compile_definitions(app PRIVATE

tests/subsys/settings/fcb/raw/placeholder.c

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# Copyright (c) 2019 Intel Corporation
33

4-
zephyr_library_named(settings_fcb_test)
5-
64
add_subdirectory(../../src settings_test_bindir)
7-
target_link_libraries(settings_fcb_test PRIVATE settings_test)
85

96
zephyr_include_directories(
107
${ZEPHYR_BASE}/subsys/settings/include
@@ -13,4 +10,4 @@ zephyr_include_directories(
1310
)
1411

1512
FILE(GLOB mysources *.c)
16-
zephyr_library_sources(${mysources})
13+
target_sources(app PRIVATE ${mysources})
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# Copyright (c) 2019 Nordic Semiconductor ASA
33

4-
zephyr_library_named(settings_test_fs)
5-
6-
# zephyr_library() is here in "app-mode", see
7-
# https://github.com/zephyrproject-rtos/zephyr/issues/19582
8-
# Random build failures without this, depends on the number of threads.
9-
add_dependencies(settings_test_fs
10-
zephyr_generated_headers
11-
)
12-
134
FILE(GLOB fssources *.c )
14-
zephyr_library_sources(${fssources})
15-
zephyr_library_link_libraries(kernel)
5+
target_sources(app PRIVATE ${fssources})

tests/subsys/settings/functional/fcb/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ project(functional_fcb)
88
target_sources(app PRIVATE placeholder.c)
99

1010
add_subdirectory(../src func_test_bindir)
11-
target_link_libraries(app PRIVATE settings_func_test)
1211

1312
if(TEST)
1413
target_compile_definitions(app PRIVATE

tests/subsys/settings/functional/nvs/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ project(functional_nvs)
88
target_sources(app PRIVATE placeholder.c)
99

1010
add_subdirectory(../src func_test_bindir)
11-
target_link_libraries(app PRIVATE settings_func_test)
1211

1312
if(TEST)
1413
target_compile_definitions(app PRIVATE
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
zephyr_library_named( settings_func_test)
4-
53
zephyr_include_directories(
64
${ZEPHYR_BASE}/subsys/settings/include
75
${ZEPHYR_BASE}/subsys/settings/src
86
)
97

10-
zephyr_library_sources(settings_basic_test.c)
11-
12-
# zephyr_library() is here in "app-mode", see
13-
# https://github.com/zephyrproject-rtos/zephyr/issues/19582
14-
# Random build failures without this, depends on the number of threads.
15-
add_dependencies(
16-
settings_func_test
17-
zephyr_generated_headers
18-
)
8+
target_sources(app PRIVATE settings_basic_test.c)

tests/subsys/settings/littlefs/base64/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
66
project(littlefs)
77

88
add_subdirectory(../src littlefs_test_bindir)
9-
target_link_libraries(app PRIVATE settings_littlefs_test)
10-
11-
# The code is in the library common to several tests.
12-
target_sources(app PRIVATE placeholder.c)
139

1410
if(TEST)
1511
target_compile_definitions(app PRIVATE

tests/subsys/settings/littlefs/base64/placeholder.c

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/subsys/settings/littlefs/raw/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ project(littlefs_raw)
77

88
add_subdirectory(../src littlefs_test_bindir)
99

10-
target_link_libraries(app PRIVATE settings_littlefs_test)
11-
12-
# The code is in the library common to several tests.
13-
target_sources(app PRIVATE placeholder.c)
14-
1510
if(TEST)
1611
target_compile_definitions(app PRIVATE
1712
-DTEST_${TEST}

0 commit comments

Comments
 (0)