Skip to content

Commit 332857f

Browse files
bebarinorobherring
authored andcommitted
of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n
Some configurations want to enable CONFIG_KUNIT without enabling CONFIG_OF_OVERLAY. The kunit overlay code already skips if CONFIG_OF_OVERLAY isn't enabled, so this select here isn't really doing anything besides making it easier to run the tests without them skipping. Remove the select and move the config setting to the drivers/of/.kunitconfig file so that the overlay tests can be run with or without CONFIG_OF_OVERLAY set to test either behavior. Fixes: 5c9dd72 ("of: Add a KUnit test for overlays and test managed APIs") Signed-off-by: Stephen Boyd <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 6e0391e commit 332857f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

drivers/of/.kunitconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CONFIG_KUNIT=y
22
CONFIG_OF=y
33
CONFIG_OF_KUNIT_TEST=y
4+
CONFIG_OF_OVERLAY=y
45
CONFIG_OF_OVERLAY_KUNIT_TEST=y

drivers/of/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ config OF_OVERLAY_KUNIT_TEST
111111
tristate "Device Tree overlay KUnit tests" if !KUNIT_ALL_TESTS
112112
depends on KUNIT
113113
default KUNIT_ALL_TESTS
114-
select OF_OVERLAY
114+
select DTC
115115
help
116116
This option builds KUnit unit tests for the device tree overlay code.
117117

drivers/of/overlay_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
6565
struct device_node *np;
6666

6767
of_root_kunit_skip(test);
68+
if (!IS_ENABLED(CONFIG_OF_OVERLAY))
69+
kunit_skip(test, "requires CONFIG_OF_OVERLAY to apply overlay");
6870
if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
6971
kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE for root node");
7072

0 commit comments

Comments
 (0)