aboutsummaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorSimon Glass2021-03-25 10:44:33 +1300
committerSimon Glass2021-04-06 16:33:19 +1200
commitd4a1592a9908f4278f306ff9f11e63c010e05704 (patch)
treeb5770c45b4a23e926a082983563829e6b4f9df70 /include/test
parent4c30d18ed38c5ae84ed91da0f9d1ba4c9e83bffc (diff)
test: Allow tests to run on any board
Due to a recent change, tests are limited to running on sandbox only. Correct this so that any architecture can run them. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Sean Anderson <seanga2@gmail.com> Fixes: c79705ea938 ("test: Move dm_test_init() into test-main.c") Tested-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/test.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/test/test.h b/include/test/test.h
index 0b124edd601..bf7d785d8ed 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -124,4 +124,13 @@ enum {
*/
struct udevice *testbus_get_clear_removed(void);
+static inline void arch_reset_for_test(void)
+{
+#ifdef CONFIG_SANDBOX
+#include <asm/state.h>
+
+ state_reset_for_test(state_get_current());
+#endif
+}
+
#endif /* __TEST_TEST_H */