tests: pm: select HAS_PM

Some tests provide their own PM hooks, adapted for testing purposes. Add
a new option to select HAS_PM, so that CONFIG_PM can be enabled.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2023-07-18 11:21:35 +02:00 committed by Fabio Baltieri
parent 3d2194f11e
commit bddf2d9dc0
6 changed files with 64 additions and 0 deletions

View file

@ -8,3 +8,9 @@ endmenu
module = APP module = APP
module-str = Application module-str = Application
source "subsys/logging/Kconfig.template.log_config" source "subsys/logging/Kconfig.template.log_config"
config APP_PROVIDE_PM_HOOKS
bool "Application provides PM hooks"
default y
select HAS_PM

View file

@ -0,0 +1,11 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
menu "Zephyr"
source "Kconfig.zephyr"
endmenu
config TEST_PROVIDE_PM_HOOKS
bool "Provide PM hooks for test purposes"
default y
select HAS_PM

View file

@ -0,0 +1,11 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
menu "Zephyr"
source "Kconfig.zephyr"
endmenu
config TEST_PROVIDE_PM_HOOKS
bool "Provide PM hooks for test purposes"
default y
select HAS_PM

View file

@ -9,6 +9,20 @@
#include <zephyr/sys_clock.h> #include <zephyr/sys_clock.h>
#include <zephyr/ztest.h> #include <zephyr/ztest.h>
void pm_state_set(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
ARG_UNUSED(state);
}
void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(state);
ARG_UNUSED(substate_id);
irq_unlock(0);
}
#ifdef CONFIG_PM_POLICY_DEFAULT #ifdef CONFIG_PM_POLICY_DEFAULT
/** /**
* @brief Test the behavior of pm_policy_next_state() when * @brief Test the behavior of pm_policy_next_state() when

View file

@ -0,0 +1,11 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
menu "Zephyr"
source "Kconfig.zephyr"
endmenu
config TEST_PROVIDE_PM_HOOKS
bool "Provide PM hooks for test purposes"
default y
select HAS_PM

View file

@ -0,0 +1,11 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
menu "Zephyr"
source "Kconfig.zephyr"
endmenu
config TEST_PROVIDE_PM_HOOKS
bool "Provide PM hooks for test purposes"
default y
select HAS_PM