summaryrefslogtreecommitdiff
path: root/common/test_util.c
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2022-03-22 09:41:28 +0100
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-30 09:30:34 +0000
commita38a395160a0af084e6fe3c03e53cd0e4c74e40e (patch)
tree9ec0b3089a16dc93f29ccb286d0ac72c3335e257 /common/test_util.c
parent52b8fb0dac7e3981e465b4c499d0607f227cfbfe (diff)
downloadchrome-ec-a38a395160a0af084e6fe3c03e53cd0e4c74e40e.tar.gz
test_util: Add function to set next state without reboot
Some tests (eg. panic data tests) will require to set the next state without immediate reboot. In this case the test is responsible to reboot the board with one of the following ways - crash, hard reboot and soft reboot. BUG=b:221087395 BRANCH=none TEST=Run some EC tests. Make sure test passes Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Idf75fb4c2f4313c03f68ed99e95b14d0e0807b0d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3555748 Reviewed-by: Andrea Grandi <agrandi@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Patryk Duda <patrykd@google.com>
Diffstat (limited to 'common/test_util.c')
-rw-r--r--common/test_util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/test_util.c b/common/test_util.c
index b23f85509b..287bcbeddf 100644
--- a/common/test_util.c
+++ b/common/test_util.c
@@ -112,11 +112,16 @@ test_mockable void test_clean_up(void)
{
}
+void test_set_next_step(enum test_state_t step)
+{
+ system_set_scratchpad(TEST_STATE_MASK(step));
+}
+
void test_reboot_to_next_step(enum test_state_t step)
{
ccprintf("Rebooting to next test step...\n");
cflush();
- system_set_scratchpad(TEST_STATE_MASK(step));
+ test_set_next_step(step);
system_reset(SYSTEM_RESET_HARD);
}