[utest][i2c] 增加 I2C 框架模拟总线测试 (#11982)

覆盖消息转发、10 位地址、错误传播、锁释放和收发返回值。
This commit is contained in:
usualtreee authored and GitHub committed 2026-11-05 11:18:32 +08:00
1 parent 54862ee1e8
commit bd99153931
4 files changed
+388

No files matched your search

+8
View File
@@ -339,6 +339,14 @@ if RT_USING_I2C
default 10
endif
endif
config RT_UTEST_I2C
bool "I2C framework Test"
default n
depends on RT_USING_UTESTCASES
help
Run the I2C framework test with simulated buses. No I2C hardware
is required.
endif
if RT_USING_DM && RT_USING_I2C
+6
View File
@@ -1,5 +1,6 @@
Import('RTT_ROOT')
from building import *
import os
cwd = GetCurrentDir()
src = Split("""
@@ -19,4 +20,9 @@ path = [cwd + '/../include']
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_I2C'], CPPPATH = path)
list = os.listdir(cwd)
for item in list:
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
group = group + SConscript(os.path.join(item, 'SConscript'))
Return('group')
+13
View File
@@ -0,0 +1,13 @@
Import('rtconfig')
from building import *
cwd = GetCurrentDir()
src = []
CPPPATH = [cwd, cwd + '/../../include']
if GetDepend(['RT_UTEST_I2C']):
src += ['i2c_tc.c']
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_I2C'], CPPPATH = CPPPATH)
Return('group')
File diff suppressed because it is too large. Load diff