Skip to content

Commit b12343e

Browse files
authored
[nrfconnect] Change Zephyr native tests target to native_sim (#37686)
* [nrfconnect] Change native_posix_64 to native_sim * Build Zephyr native tests for 32-bit target. * Use native_sim as native_posix_64 is deprecated and removed in recent version of Zephyr. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no> * [nrfconnect] Remove CHIP_CONFIG_LAMBDA_EVENT_SIZE override CHIP_CONFIG_LAMBDA_EVENT_SIZE should not be needed when building for 32-bit target. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no> --------- Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 30964ae commit b12343e

File tree

10 files changed

+17
-20
lines changed

10 files changed

+17
-20
lines changed

.github/workflows/examples-nrfconnect.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
run: |
199199
# Temporarily fix link issue
200200
sed -i '151s/<LINK_FLAGS> //' /opt/NordicSemiconductor/nrfconnect/zephyr/cmake/linker/ld/target.cmake
201-
scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-posix-64-tests build"
201+
scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target nrf-native-sim-tests build"
202202
- name: Uploading Failed Test Logs
203203
uses: actions/upload-artifact@v4
204204
if: ${{ failure() && !env.ACT }}

config/nrfconnect/chip-module/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ if (CONFIG_CHIP_CRYPTO_PSA)
186186
matter_add_gn_arg_bool ("chip_crypto_psa_spake2p" CONFIG_PSA_WANT_ALG_SPAKE2P_MATTER)
187187
endif()
188188

189-
if (BOARD STREQUAL "native_posix")
189+
if (BOARD STREQUAL "native_sim")
190190
matter_add_gn_arg_string("target_cpu" "x86")
191-
elseif (BOARD STREQUAL "native_posix_64")
191+
elseif (BOARD STREQUAL "native_sim/native/64")
192192
matter_add_gn_arg_string("target_cpu" "x64")
193193
endif()
194194

config/nxp/chip-module/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ else()
122122
endif()
123123

124124

125-
# if (BOARD STREQUAL "native_posix")
125+
# if (BOARD STREQUAL "native_sim")
126126
# matter_add_gn_arg_string("target_cpu" "x86")
127-
# elseif (BOARD STREQUAL "native_posix_64")
127+
# elseif (BOARD STREQUAL "native_sim/native/64")
128128
# matter_add_gn_arg_string("target_cpu" "x64")
129129
# endif()
130130

config/zephyr/chip-module/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ if(CONFIG_CHIP)
101101
matter_add_gn_arg_bool("chip_inet_config_enable_tcp_endpoint" FALSE)
102102
matter_add_gn_arg_bool("chip_enable_read_client" CONFIG_CHIP_ENABLE_READ_CLIENT)
103103

104-
if(BOARD STREQUAL "native_posix")
104+
if(BOARD STREQUAL "native_sim")
105105
matter_add_gn_arg_string("target_cpu" "x86")
106-
elseif(BOARD STREQUAL "native_posix_64")
106+
elseif(BOARD STREQUAL "native_sim/native/64")
107107
matter_add_gn_arg_string("target_cpu" "x64")
108108
endif()
109109

scripts/build/build/targets.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ def BuildNrfNativeTarget():
304304
target = BuildTarget('nrf', NrfConnectBuilder)
305305

306306
target.AppendFixedTargets([
307-
TargetPart('native-posix-64-tests',
308-
board=NrfBoard.NATIVE_POSIX_64, app=NrfApp.UNIT_TESTS),
307+
TargetPart('native-sim-tests',
308+
board=NrfBoard.NATIVE_SIM, app=NrfApp.UNIT_TESTS),
309309
])
310310

311311
return target

scripts/build/builders/nrf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class NrfBoard(Enum):
118118
NRF52840DK = auto()
119119
NRF52840DONGLE = auto()
120120
NRF5340DK = auto()
121-
NATIVE_POSIX_64 = auto()
121+
NATIVE_SIM = auto()
122122

123123
def GnArgName(self):
124124
if self == NrfBoard.NRF52840DK:
@@ -127,8 +127,8 @@ def GnArgName(self):
127127
return 'nrf52840dongle_nrf52840'
128128
elif self == NrfBoard.NRF5340DK:
129129
return 'nrf5340dk_nrf5340_cpuapp'
130-
elif self == NrfBoard.NATIVE_POSIX_64:
131-
return 'native_posix_64'
130+
elif self == NrfBoard.NATIVE_SIM:
131+
return 'native_sim'
132132
else:
133133
raise Exception('Unknown board type: %r' % self)
134134

scripts/build/testdata/all_targets_linux_x64.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nxp-{k32w0,k32w1,rt1060,rt1170,rw61x,rw61x_eth,mcxw71}-{zephyr,freertos}-{lighti
1717
mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug]
1818
mw320-all-clusters-app
1919
nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc]
20-
nrf-native-posix-64-tests
20+
nrf-native-sim-tests
2121
nuttx-x64-light
2222
qpg-qpg6105-{lock,light,shell,persistent-storage,light-switch,thermostat}[-updateimage]
2323
stm32-stm32wb5mm-dk-light

src/app/tests/AppTestContext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void AppContext::TearDownTestSuite()
5252
// This can particularly be a problem when this unprocessed work involves reporting engine runs,
5353
// since those can take a while and cause later tests to not reach their queued work before
5454
// their timeouts hit. This is only an issue in setups where all unit tests are compiled into
55-
// a single file (e.g. nRF CI (Zephyr native_posix)).
55+
// a single file (e.g. nRF CI (Zephyr native_sim)).
5656
//
5757
// Work around this issue by doing a DrainAndServiceIO() here to attempt to flush out any queued-up work.
5858
//

src/test_driver/nrfconnect/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
# @file
1919
# CMake project for building and running selected CHIP unit tests using
2020
# 'nrfconnect' platform integration layer in CHIP and Zephyr
21-
# 'native_posix[_64]' platforms. Note that certain design decisions behind
22-
# the native_posix platforms make them inapplicable for some unit tests,
21+
# 'native_sim[/native/64]' platforms. Note that certain design decisions behind
22+
# the native_sim platforms make them inapplicable for some unit tests,
2323
# hence only a subset of CHIP unit tests is listed in the project.
24-
# See: https://docs.zephyrproject.org/1.12.0/boards/posix/native_posix/doc/board.html
24+
# See: https://docs.zephyrproject.org/4.0.0/boards/native/native_sim/doc/index.html
2525
# for more details.
2626
#
2727

src/test_driver/nrfconnect/main/include/CHIPProjectConfig.h

-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,4 @@
3333
// Enable unit-test only features
3434
#define CONFIG_BUILD_FOR_HOST_UNIT_TEST 1
3535

36-
// Increase max. lambda event size
37-
#define CHIP_CONFIG_LAMBDA_EVENT_SIZE 32
38-
3936
#endif // CHIP_PROJECT_CONFIG_H

0 commit comments

Comments
 (0)