blob: 31016eedbf8a947d428a389d6fe2902c25b383d5 [file] [log] [blame]
Simon Glassf37d29a2023-09-14 10:55:44 -06001menu "Testing"
Heinrich Schuchardt76a00a32023-04-03 20:27:43 +02002
3config UNIT_TEST
Joe Hershberger437176b2015-05-20 14:27:31 -05004 bool "Unit tests"
Simon Glass2a4df7c2023-10-26 14:31:17 -04005 depends on CMDLINE
Joe Hershberger437176b2015-05-20 14:27:31 -05006 help
7 Select this to compile in unit tests for various parts of
8 U-Boot. Test suites will be subcommands of the "ut" command.
9 This does not require sandbox to be included, but it is most
10 often used there.
Joe Hershberger3a77be52015-05-20 14:27:27 -050011
Simon Glassbf40eee2020-10-25 20:38:26 -060012config SPL_UNIT_TEST
13 bool "Unit tests in SPL"
Tom Rini0a83cc22022-06-10 23:03:09 -040014 depends on SPL
Simon Glassbf40eee2020-10-25 20:38:26 -060015 # We need to be able to unbind devices for tests to work
16 select SPL_DM_DEVICE_REMOVE
17 help
18 Select this to enable unit tests in SPL. Most test are designed for
19 running in U-Boot proper, but some are intended for SPL, such as
20 of-platdata and SPL handover. To run these tests with the sandbox_spl
21 board, use the -u (unit test) option.
22
Simon Glasse36afcd2025-02-07 11:30:43 -070023if UNIT_TEST
24
Simon Glass5fa92d62025-02-07 11:30:35 -070025config UNIT_TEST_DURATION
26 bool "Report unit-test duration"
Simon Glass5fa92d62025-02-07 11:30:35 -070027 default y
28 help
29 Enable this short the time taken by each test suite. This is reported
30 after the suite runs, alongside the pass/fail results. In addition,
31 an overall total is reported if multiple suites are run.
32
Heinrich Schuchardtf77a6352019-01-30 07:53:31 +010033config UT_LIB
34 bool "Unit tests for library functions"
Simon Glass644d8072022-08-01 07:57:59 -060035 default y if !SANDBOX_VPL
Heinrich Schuchardtf77a6352019-01-30 07:53:31 +010036 help
37 Enables the 'ut lib' command which tests library functions like
AKASHI Takahirob5124e32019-11-13 09:45:02 +090038 memcat(), memcyp(), memmove() and ASN1 compiler/decoder.
39
40if UT_LIB
41
42config UT_LIB_ASN1
43 bool "Unit test for asn1 compiler and decoder function"
Raymond Mao37ac1272024-10-03 14:50:39 -070044 depends on SANDBOX && !MBEDTLS_LIB_X509
AKASHI Takahirob5124e32019-11-13 09:45:02 +090045 default y
46 imply ASYMMETRIC_KEY_TYPE
47 imply ASYMMETRIC_PUBLIC_KEY_SUBTYPE
48 imply X509_CERTIFICATE_PARSER
49 imply PKCS7_MESSAGE_PARSER
50 imply RSA_PUBLIC_KEY_PARSER
51 help
52 Enables a test which exercises asn1 compiler and decoder function
53 via various parsers.
54
Steffen Jaeckel229bd512021-07-08 15:57:33 +020055config UT_LIB_CRYPT
56 bool "Unit test for crypt-style password hashing"
57 depends on !SPL && AUTOBOOT_KEYED && AUTOBOOT_ENCRYPTION
58 default y
59 select CRYPT_PW
60 select CRYPT_PW_SHA256
61 select CRYPT_PW_SHA512
62 help
63 Enables a test for the crypt-style password hash functions.
64
AKASHI Takahirof24cd6c2020-02-21 15:13:00 +090065config UT_LIB_RSA
66 bool "Unit test for rsa_verify() function"
67 depends on RSA
68 depends on RSA_VERIFY_WITH_PKEY
69 select IMAGE_SIGN_INFO
70 default y
71 help
72 Enables rsa_verify() test, currently rsa_verify_with_pkey only()
73 only, at the 'ut lib' command.
74
Simon Glasse36afcd2025-02-07 11:30:43 -070075endif # UT_LIB
Heinrich Schuchardtf77a6352019-01-30 07:53:31 +010076
Simon Glass804aa372023-10-01 19:15:15 -060077config UT_BOOTSTD
78 bool "Unit tests for standard boot"
Simon Glasse36afcd2025-02-07 11:30:43 -070079 depends on BOOTSTD && SANDBOX
Simon Glass804aa372023-10-01 19:15:15 -060080 default y
81
Heinrich Schuchardt7b3b0032020-10-31 08:59:25 +010082config UT_COMPRESSION
83 bool "Unit test for compression"
Brandon Maier61c55e82023-01-12 10:27:46 -060084 depends on CMDLINE && GZIP_COMPRESSED && BZIP2 && LZMA && LZO && LZ4 && ZSTD
Heinrich Schuchardt7b3b0032020-10-31 08:59:25 +010085 default y
86 help
87 Enables tests for compression and decompression routines for simple
88 sanity and for buffer overflow conditions.
89
Heinrich Schuchardtf433d502020-02-26 21:48:18 +010090config UT_LOG
91 bool "Unit tests for logging functions"
Heinrich Schuchardtf433d502020-02-26 21:48:18 +010092 default y
93 help
94 Enables the 'ut log' command which tests logging functions like
95 log_err().
96 See also CONFIG_LOG_TEST which provides the 'log test' command.
97
Joe Hershbergeree20efe2015-05-20 14:27:30 -050098config UT_TIME
Simon Glass9b4221b2015-05-02 09:25:02 -060099 bool "Unit tests for time functions"
100 help
Joe Hershbergeree20efe2015-05-20 14:27:30 -0500101 Enables the 'ut time' command which tests that the time functions
Simon Glass9b4221b2015-05-02 09:25:02 -0600102 work correctly. The test is fairly simple and will not catch all
103 problems. But if you are having problems with udelay() and the like,
104 this is a good place to start.
105
Heinrich Schuchardtb8b6c812018-08-31 21:31:28 +0200106config UT_UNICODE
107 bool "Unit tests for Unicode functions"
Heinrich Schuchardtb8b6c812018-08-31 21:31:28 +0200108 default y
Heinrich Schuchardt013aabb2022-05-02 06:27:00 +0200109 select CHARSET
Heinrich Schuchardtb8b6c812018-08-31 21:31:28 +0200110 help
111 Enables the 'ut unicode' command which tests that the functions for
112 manipulating Unicode strings work correctly.
113
Simon Glass9dd430d2015-02-05 21:41:37 -0700114source "test/dm/Kconfig"
Joe Hershberger26e038f2015-05-20 14:27:36 -0500115source "test/env/Kconfig"
Sean Andersondcd91b12023-10-14 16:47:57 -0400116source "test/image/Kconfig"
Simon Glass644d8072022-08-01 07:57:59 -0600117source "test/lib/Kconfig"
Heiko Stuebner1c9bb9b2019-10-23 16:46:41 +0200118source "test/optee/Kconfig"
Simon Glass04e76d52025-02-07 11:30:39 -0700119source "test/fdt_overlay/Kconfig"
Heinrich Schuchardt76a00a32023-04-03 20:27:43 +0200120
Simon Glasse36afcd2025-02-07 11:30:43 -0700121endif # UNIT_TEST
122
Simon Glassf37d29a2023-09-14 10:55:44 -0600123config POST
124 bool "Power On Self Test support"
125 help
126 See doc/README.POST for more details
127
Heinrich Schuchardt76a00a32023-04-03 20:27:43 +0200128endmenu