diff --git a/tests/lib/cpp/cxx/prj.conf b/tests/lib/cpp/cxx/prj.conf index 15ae9ce1ebd4909..158eb89a201e4c0 100644 --- a/tests/lib/cpp/cxx/prj.conf +++ b/tests/lib/cpp/cxx/prj.conf @@ -5,8 +5,21 @@ CONFIG_ZTEST_STACK_SIZE=2048 CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=128 CONFIG_CRC=y +# Enable optional features that are off by default to cover as much as +# possible of the same .h files. Ideally, kconfiglib.py would support +# "randconfig" because turning on some options can also reduce test +# coverage in some areas. But: 1. combinatorial explosion, 2. it does +# not. + # RTIO CONFIG_RTIO=y CONFIG_RTIO_SUBMIT_SEM=y CONFIG_RTIO_CONSUME_SEM=y CONFIG_RTIO_SYS_MEM_BLOCKS=y + +# Enable more features and C++ coverage in device.h, pm/device.h, pm.h... +CONFIG_PM=y +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y +# Deprecated but on by default! Silence the warning: +CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE=n diff --git a/tests/lib/cpp/cxx/src/main.cpp b/tests/lib/cpp/cxx/src/main.cpp index a8a49a3a2540909..8b149290bab6573 100644 --- a/tests/lib/cpp/cxx/src/main.cpp +++ b/tests/lib/cpp/cxx/src/main.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -147,3 +148,7 @@ ZTEST_SUITE(cxx_tests, NULL, NULL, NULL, NULL, NULL); DEVICE_DT_DEFINE(DT_NODELABEL(test_dev0_boot), NULL, NULL, NULL, NULL, POST_KERNEL, 33, NULL); DEVICE_DT_DEFINE(DT_NODELABEL(test_dev1_dfr), NULL, NULL, NULL, NULL, POST_KERNEL, 33, NULL); + +static int fake_pm_action(const struct device *dev, + enum pm_device_action pm_action) { return -1; } +PM_DEVICE_DT_DEFINE(DT_NODELABEL(test_dev0_boot), fake_pm_action);