summaryrefslogtreecommitdiff
path: root/test/test-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-main.c')
-rw-r--r--test/test-main.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/test/test-main.c b/test/test-main.c
index 5931e94a915..ea959f4e859 100644
--- a/test/test-main.c
+++ b/test/test-main.c
@@ -10,6 +10,7 @@
#include <cyclic.h>
#include <dm.h>
#include <event.h>
+#include <net.h>
#include <of_live.h>
#include <os.h>
#include <dm/ofnode.h>
@@ -296,17 +297,28 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test)
uts->start = mallinfo();
- if (test->flags & UT_TESTF_SCAN_PDATA) {
+ if (test->flags & UT_TESTF_SCAN_PDATA)
ut_assertok(dm_scan_plat(false));
- ut_assertok(dm_scan_other(false));
- }
if (test->flags & UT_TESTF_PROBE_TEST)
ut_assertok(do_autoprobe(uts));
if (!CONFIG_IS_ENABLED(OF_PLATDATA) &&
- (test->flags & UT_TESTF_SCAN_FDT))
+ (test->flags & UT_TESTF_SCAN_FDT)) {
+ /*
+ * only set this if we know the ethernet uclass will be created
+ */
+ eth_set_enable_bootdevs(test->flags & UT_TESTF_ETH_BOOTDEV);
+ test_sf_set_enable_bootdevs(test->flags & UT_TESTF_SF_BOOTDEV);
ut_assertok(dm_extended_scan(false));
+ }
+
+ /*
+ * Do this after FDT scan since dm_scan_other() in bootstd-uclass.c
+ * checks for the existence of bootstd
+ */
+ if (test->flags & UT_TESTF_SCAN_PDATA)
+ ut_assertok(dm_scan_other(false));
if (IS_ENABLED(CONFIG_SANDBOX) && (test->flags & UT_TESTF_OTHER_FDT)) {
/* make sure the other FDT is available */
@@ -635,9 +647,5 @@ int ut_run_list(const char *category, const char *prefix,
else
printf("Failures: %d\n", uts.fail_count);
- /* Best efforts only...ignore errors */
- if (has_dm_tests)
- dm_test_restore(uts.of_root);
-
return ret;
}