test: Use a local variable for test state
authorSimon Glass <sjg@chromium.org>
Mon, 8 Mar 2021 00:35:04 +0000 (17:35 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 12 Mar 2021 14:57:30 +0000 (09:57 -0500)
commitfe806861a98b4ad524d070c6d7b9d20fd475ec6f
tree59df6d3172d2ec6758deb6ee14fa872be5837b6a
parentd2281bb09b0ebf580f8efe23c84c240a2f3ea9bb
test: Use a local variable for test state

At present we use a global test state for all driver-model tests. Make use
of a local struct like we do with the other tests.

To make this work, add functions to get and set this state. When a test
starts, the state is set (so it can be used in the test). When a test
finishes, the state is unset, so it cannot be used by mistake.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/test/ut.h
test/dm/test-dm.c
test/dm/test-driver.c
test/dm/test-uclass.c
test/test-main.c