Skip to content

Commit f922ade

Browse files
authored
[utest][pin] add pin loopback utest (#11445)
* [utest][pin] add pin loopback utest * [utest][pin] add BSP CI coverage * [utest][pin] fix BSP CI config * [utest][pin] fix ra8p1 utest link section
1 parent 7071ba3 commit f922ade

10 files changed

Lines changed: 437 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
scons.args: &scons
2+
scons_arg:
3+
- '--strict'
4+
5+
# ------ utest CI ------
6+
utest.pin:
7+
<<: *scons
8+
kconfig:
9+
- CONFIG_RT_USING_UTESTCASES=y
10+
- CONFIG_RT_CONSOLEBUF_SIZE=256
11+
- CONFIG_RT_UTEST_PIN=y

bsp/nxp/mcx/mcxa/frdm-mcxa366/.ci/attachconfig/ci.attachconfig.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ Peripheral.arduino:
3131
kconfig:
3232
- CONFIG_BSP_USING_ARDUINO=y
3333

34+
# ------ utest CI ------
35+
utest.pin:
36+
<<: *scons
37+
kconfig:
38+
- CONFIG_RT_USING_UTESTCASES=y
39+
- CONFIG_RT_CONSOLEBUF_SIZE=256
40+
- CONFIG_RT_UTEST_PIN=y
41+

bsp/renesas/ra8p1-titan-board/.ci/attachconfig/attachconfig.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ devices.ethernet:
3838
devices.rtc:
3939
kconfig:
4040
- CONFIG_BSP_USING_ONCHIP_RTC=y
41+
42+
# ------ utest CI ------
43+
utest.pin:
44+
kconfig:
45+
- CONFIG_RT_USING_UTESTCASES=y
46+
- CONFIG_RT_CONSOLEBUF_SIZE=256
47+
- CONFIG_RT_UTEST_PIN=y

bsp/renesas/ra8p1-titan-board/script/fsp.ld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,12 @@ SECTIONS
455455
KEEP(*(VSymTab))
456456
__vsymtab_end = .;
457457

458+
/* section information for utest */
459+
. = ALIGN(4);
460+
__rt_utest_tc_tab_start = .;
461+
KEEP(*(UtestTcTab))
462+
__rt_utest_tc_tab_end = .;
463+
458464
/* section information for initial. */
459465
. = ALIGN(4);
460466
__rt_init_start = .;

bsp/stm32/stm32f407-rt-spark/.ci/attachconfig/ci.attachconfig.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ peripheral.sram:
195195
peripheral.usb_mouse:
196196
kconfig:
197197
- CONFIG_BSP_USING_USB_MOUSE=y
198+
# ------ utest CI ------
199+
utest.pin:
200+
<<: *scons
201+
kconfig:
202+
- CONFIG_RT_USING_UTESTCASES=y
203+
- CONFIG_RT_CONSOLEBUF_SIZE=256
204+
- CONFIG_RT_UTEST_PIN=y
198205
# ------ component CI ------
199206
component.cherryusb_cdc:
200207
kconfig:

components/drivers/pin/SConscript

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from building import *
23

34
group = []
@@ -21,4 +22,9 @@ if GetDepend(['RT_PIN_PL061']):
2122

2223
group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH)
2324

25+
list = os.listdir(cwd)
26+
for item in list:
27+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
28+
group = group + SConscript(os.path.join(item, 'SConscript'))
29+
2430
Return('group')
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
menu "Pin Test"
2+
depends on RT_USING_PIN
3+
4+
config RT_UTEST_PIN
5+
bool "Pin Loopback Test"
6+
default n
7+
8+
if RT_UTEST_PIN
9+
10+
config RT_UTEST_PIN_OUT_NAME
11+
string "Output Pin Name for Pin Test"
12+
default ""
13+
help
14+
Optional hardware pin name, such as PA.0 or P0.12. Leave empty to
15+
use RT_UTEST_PIN_OUT_NUM.
16+
17+
config RT_UTEST_PIN_IN_NAME
18+
string "Input Pin Name for Pin Test"
19+
default ""
20+
help
21+
Optional hardware pin name, such as PA.1 or P0.13. Leave empty to
22+
use RT_UTEST_PIN_IN_NUM.
23+
24+
config RT_UTEST_PIN_OUT_NUM
25+
int "Output Pin Number for Pin Test"
26+
default -1
27+
28+
config RT_UTEST_PIN_IN_NUM
29+
int "Input Pin Number for Pin Test"
30+
default -1
31+
32+
config RT_UTEST_PIN_SETTLE_MS
33+
int "Settle Delay in Milliseconds"
34+
range 0 1000
35+
default 2
36+
37+
config RT_UTEST_PIN_IRQ_TIMEOUT_MS
38+
int "IRQ Timeout in Milliseconds"
39+
range 1 60000
40+
default 500
41+
42+
config RT_UTEST_PIN_IRQ
43+
bool "Pin IRQ Loopback Test"
44+
default y
45+
46+
endif
47+
48+
endmenu
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Import('rtconfig')
2+
from building import *
3+
4+
cwd = GetCurrentDir()
5+
src = []
6+
CPPPATH = [cwd]
7+
8+
if GetDepend(['RT_UTEST_PIN']):
9+
src += Glob('*.c')
10+
11+
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_PIN'], CPPPATH = CPPPATH)
12+
13+
Return('group')

0 commit comments

Comments
 (0)