Rather than having this condition defined separately for each suite,
bracket all options with 'if UNIT_TEST'.

Signed-off-by: Simon Glass <s...@chromium.org>
---

(no changes since v1)

 test/Kconfig             | 14 ++++++--------
 test/dm/Kconfig          |  2 +-
 test/env/Kconfig         |  1 -
 test/fdt_overlay/Kconfig |  2 +-
 test/optee/Kconfig       |  2 +-
 5 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/test/Kconfig b/test/Kconfig
index 01d64642fdb..31016eedbf8 100644
--- a/test/Kconfig
+++ b/test/Kconfig
@@ -20,9 +20,10 @@ config SPL_UNIT_TEST
          of-platdata and SPL handover. To run these tests with the sandbox_spl
          board, use the -u (unit test) option.
 
+if UNIT_TEST
+
 config UNIT_TEST_DURATION
        bool "Report unit-test duration"
-       depends on UNIT_TEST
        default y
        help
          Enable this short the time taken by each test suite. This is reported
@@ -31,7 +32,6 @@ config UNIT_TEST_DURATION
 
 config UT_LIB
        bool "Unit tests for library functions"
-       depends on UNIT_TEST
        default y if !SANDBOX_VPL
        help
          Enables the 'ut lib' command which tests library functions like
@@ -72,16 +72,15 @@ config UT_LIB_RSA
          Enables rsa_verify() test, currently rsa_verify_with_pkey only()
          only, at the 'ut lib' command.
 
-endif
+endif  # UT_LIB
 
 config UT_BOOTSTD
        bool "Unit tests for standard boot"
-       depends on UNIT_TEST && BOOTSTD && SANDBOX
+       depends on BOOTSTD && SANDBOX
        default y
 
 config UT_COMPRESSION
        bool "Unit test for compression"
-       depends on UNIT_TEST
        depends on CMDLINE && GZIP_COMPRESSED && BZIP2 && LZMA && LZO && LZ4 && 
ZSTD
        default y
        help
@@ -90,7 +89,6 @@ config UT_COMPRESSION
 
 config UT_LOG
        bool "Unit tests for logging functions"
-       depends on UNIT_TEST
        default y
        help
          Enables the 'ut log' command which tests logging functions like
@@ -99,7 +97,6 @@ config UT_LOG
 
 config UT_TIME
        bool "Unit tests for time functions"
-       depends on UNIT_TEST
        help
          Enables the 'ut time' command which tests that the time functions
          work correctly. The test is fairly simple and will not catch all
@@ -108,7 +105,6 @@ config UT_TIME
 
 config UT_UNICODE
        bool "Unit tests for Unicode functions"
-       depends on UNIT_TEST
        default y
        select CHARSET
        help
@@ -122,6 +118,8 @@ source "test/lib/Kconfig"
 source "test/optee/Kconfig"
 source "test/fdt_overlay/Kconfig"
 
+endif  # UNIT_TEST
+
 config POST
        bool "Power On Self Test support"
        help
diff --git a/test/dm/Kconfig b/test/dm/Kconfig
index e5b341e523a..640421c2a79 100644
--- a/test/dm/Kconfig
+++ b/test/dm/Kconfig
@@ -1,6 +1,6 @@
 config UT_DM
        bool "Enable driver model unit test command"
-       depends on SANDBOX && UNIT_TEST
+       depends on SANDBOX
        help
          This enables the 'ut dm' command which runs a series of unit
          tests on the driver model code. Each subsystem (uclass) is tested.
diff --git a/test/env/Kconfig b/test/env/Kconfig
index 6cb82337b36..21d88f47a6d 100644
--- a/test/env/Kconfig
+++ b/test/env/Kconfig
@@ -1,6 +1,5 @@
 config UT_ENV
        bool "Enable env unit tests"
-       depends on UNIT_TEST
        default y
        help
          This enables the 'ut env' command which runs a series of unit
diff --git a/test/fdt_overlay/Kconfig b/test/fdt_overlay/Kconfig
index c2bb70fc970..c50b8822544 100644
--- a/test/fdt_overlay/Kconfig
+++ b/test/fdt_overlay/Kconfig
@@ -1,6 +1,6 @@
 config UT_FDT_OVERLAY
        bool "Enable Device Tree Overlays Unit Tests"
-       depends on UNIT_TEST && OF_CONTROL && SANDBOX
+       depends on OF_CONTROL && SANDBOX
        default y
        select OF_LIBFDT_OVERLAY
        help
diff --git a/test/optee/Kconfig b/test/optee/Kconfig
index 2f6834aa3b4..63e2cbf79c7 100644
--- a/test/optee/Kconfig
+++ b/test/optee/Kconfig
@@ -1,6 +1,6 @@
 config UT_OPTEE
        bool "Enable OP-TEE Unit Tests"
-       depends on UNIT_TEST && OF_CONTROL && OPTEE
+       depends on OF_CONTROL && OPTEE
        default y
        help
          This enables the 'ut optee' command which runs a series of unit
-- 
2.43.0

Reply via email to