]> Git Repo - linux.git/commitdiff
of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n
authorStephen Boyd <[email protected]>
Wed, 16 Oct 2024 21:20:15 +0000 (14:20 -0700)
committerRob Herring (Arm) <[email protected]>
Fri, 15 Nov 2024 20:03:28 +0000 (14:03 -0600)
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: 5c9dd72d8385 ("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]>
drivers/of/.kunitconfig
drivers/of/Kconfig
drivers/of/overlay_test.c

index 4c53d2c7a2757e1f706ae2358af0d515af5c3224..7d570cb922a179ef0df98fc1ccb793d8e8dff1b1 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_KUNIT=y
 CONFIG_OF=y
 CONFIG_OF_KUNIT_TEST=y
+CONFIG_OF_OVERLAY=y
 CONFIG_OF_OVERLAY_KUNIT_TEST=y
index 0e2d608c3e207d11adddc6e304f23a3aff7bba37..f0b8cc23c46d377f8cce792893cdf1c39fe2d1f1 100644 (file)
@@ -111,7 +111,7 @@ config OF_OVERLAY_KUNIT_TEST
        tristate "Device Tree overlay KUnit tests" if !KUNIT_ALL_TESTS
        depends on KUNIT
        default KUNIT_ALL_TESTS
-       select OF_OVERLAY
+       select DTC
        help
          This option builds KUnit unit tests for the device tree overlay code.
 
index 1f76d50fb16a5237989341b9ca50a7664a7b31be..c787524c5a887cdf87e5acc98982733e02feb847 100644 (file)
@@ -65,6 +65,8 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
        struct device_node *np;
 
        of_root_kunit_skip(test);
+       if (!IS_ENABLED(CONFIG_OF_OVERLAY))
+               kunit_skip(test, "requires CONFIG_OF_OVERLAY to apply overlay");
        if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
                kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE for root node");
 
This page took 0.055711 seconds and 4 git commands to generate.