mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-07-03 21:02:07 +00:00
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: c79705ea93
("test: Move dm_test_init() into test-main.c")
Tested-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
4c30d18ed3
commit
d4a1592a99
2 changed files with 11 additions and 3 deletions
|
@ -124,4 +124,13 @@ enum {
|
||||||
*/
|
*/
|
||||||
struct udevice *testbus_get_clear_removed(void);
|
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 */
|
#endif /* __TEST_TEST_H */
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <asm/state.h>
|
|
||||||
#include <dm/root.h>
|
#include <dm/root.h>
|
||||||
#include <dm/test.h>
|
#include <dm/test.h>
|
||||||
#include <dm/uclass-internal.h>
|
#include <dm/uclass-internal.h>
|
||||||
|
@ -46,9 +45,9 @@ static int dm_test_pre_run(struct unit_test_state *uts)
|
||||||
uts->force_fail_alloc = false;
|
uts->force_fail_alloc = false;
|
||||||
uts->skip_post_probe = false;
|
uts->skip_post_probe = false;
|
||||||
gd->dm_root = NULL;
|
gd->dm_root = NULL;
|
||||||
if (!CONFIG_IS_ENABLED(OF_PLATDATA))
|
if (IS_ENABLED(CONFIG_UT_DM) && !CONFIG_IS_ENABLED(OF_PLATDATA))
|
||||||
memset(dm_testdrv_op_count, '\0', sizeof(dm_testdrv_op_count));
|
memset(dm_testdrv_op_count, '\0', sizeof(dm_testdrv_op_count));
|
||||||
state_reset_for_test(state_get_current());
|
arch_reset_for_test();
|
||||||
|
|
||||||
/* Determine whether to make the live tree available */
|
/* Determine whether to make the live tree available */
|
||||||
gd_set_of_root(of_live ? uts->of_root : NULL);
|
gd_set_of_root(of_live ? uts->of_root : NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue