Skip to content

Commit

Permalink
dm: test: Fix running of multiple test from command line
Browse files Browse the repository at this point in the history
At present when multiple 'ut dm' commands are executed, all but the first
is run with a flat tree, even if live tree is enabled. This is because the
live tree node pointer is set to NULL and never restored.

This does not affect normal test running, which just runs all the test in
one go, but can be confusing when several individual tests are run during
the same U-Boot run.

Correct this by restoring the pointer.

Fixes: c166c47 (dm: test: Add support for running tests with livetree)
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Tested-by: Bin Meng <[email protected]>
  • Loading branch information
sjg20 authored and lbmeng committed Oct 8, 2019
1 parent fdd72be commit fe9a967
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/dm/test-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ static int dm_test_main(const char *test_name)
else
printf("Failures: %d\n", uts->fail_count);

/* Put everything back to normal so that sandbox works as expected */
#ifdef CONFIG_OF_LIVE
gd->of_root = uts->of_root;
#endif
gd->dm_root = NULL;
ut_assertok(dm_init(false));
ut_assertok(dm_init(IS_ENABLED(CONFIG_OF_LIVE)));
dm_scan_platdata(false);
dm_scan_fdt(gd->fdt_blob, false);

Expand Down

0 comments on commit fe9a967

Please sign in to comment.