Skip to content

Commit 19155bd

Browse files
hakehuangkartben
authored andcommitted
samples: magic_addr: add pytest check for magic_addr
use pytest script to check result fixes: #82759 Signed-off-by: Hake Huang <[email protected]>
1 parent d77fb49 commit 19155bd

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2024 NXP
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
import logging
6+
7+
from twister_harness import DeviceAdapter
8+
9+
logger = logging.getLogger(__name__)
10+
11+
12+
def test_magic_addr(dut: DeviceAdapter):
13+
'''
14+
tag memory twice and check result
15+
'''
16+
dut.readlines_until(regex='Cast some characters:', print_output=True)
17+
dut.write(str.encode('A'))
18+
lines = dut.readlines_until(regex='Magic DTCM address accessed', print_output=True)
19+
logger.info(lines)
20+
dut.write(str.encode('B'))
21+
lines = dut.readlines_until(regex='Magic DTCM address accessed', print_output=True)
22+
logger.info(lines)
23+
ret = any('Magic DTCM address accessed' in line for line in lines)
24+
assert ret

samples/boards/nxp/mimxrt1170_evk_cm7/magic_addr/sample.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ common:
55
integration_platforms:
66
- mimxrt1170_evk/mimxrt1176/cm7
77
- mimxrt1160_evk/mimxrt1166/cm7
8+
tags:
9+
- pytest
810
tests:
911
sample.boards.mimxrt1170_evk.magic_addr:
10-
platform_allow:
11-
- mimxrt1170_evk/mimxrt1176/cm7
12-
- mimxrt1160_evk/mimxrt1166/cm7
12+
filter: CONFIG_MEMC_NXP_FLEXRAM
13+
harness: pytest

0 commit comments

Comments
 (0)