Skip to content

Commit 93a431d

Browse files
jasonbuxiaoxiang781216
authored andcommitted
testing/drivertest: add pm_smp test
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
1 parent 7acf0ff commit 93a431d

File tree

4 files changed

+512
-2
lines changed

4 files changed

+512
-2
lines changed

testing/drivertest/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,22 @@ if(CONFIG_TESTING_DRIVER_TEST)
389389
drivertest_pm.c)
390390
endif()
391391

392+
if(CONFIG_PM AND CONFIG_SMP)
393+
nuttx_add_application(
394+
NAME
395+
cmocka_driver_pm_smp
396+
PRIORITY
397+
${CONFIG_TESTING_DRIVER_TEST_PRIORITY}
398+
STACKSIZE
399+
${CONFIG_TESTING_DRIVER_TEST_STACKSIZE}
400+
MODULE
401+
${CONFIG_TESTING_DRIVER_TEST}
402+
DEPENDS
403+
cmocka
404+
SRCS
405+
drivertest_pm_smp.c)
406+
endif()
407+
392408
if(CONFIG_PM_RUNTIME)
393409
nuttx_add_application(
394410
NAME

testing/drivertest/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,13 @@ PROGNAME += cmocka_driver_mps2_zerointerrupt
140140
endif
141141
endif
142142

143-
ifneq ($(CONFIG_PM),)
143+
ifeq ($(CONFIG_PM),y)
144144
MAINSRC += drivertest_pm.c
145145
PROGNAME += cmocka_driver_pm
146+
ifeq ($(CONFIG_SMP),y)
147+
MAINSRC += drivertest_pm_smp.c
148+
PROGNAME += cmocka_driver_pm_smp
149+
endif
146150
endif
147151

148152
ifneq ($(CONFIG_PM_RUNTIME),)

testing/drivertest/drivertest_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static void test_pm(FAR void **argv)
277277

278278
/* test when pm prepare succeeded */
279279

280-
test_pm_fake_driver_init();
280+
g_test_pm_dev.prepare_fail = false;
281281

282282
for (int state = 0; state < PM_COUNT; state++)
283283
{

0 commit comments

Comments
 (0)