summaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-11-22 08:44:38 -0600
committerTom Rini <[email protected]>2025-11-22 08:44:38 -0600
commit74c68b54977447e97b98b12c3ca7fe2a7f4a3803 (patch)
tree949504975745ed37bc3d60535b9ce17fb984c2d8 /include/test
parent2bc0715b558fa1ac5c88b11e250740b16a905837 (diff)
parentfff78d3bb25dc0c4b20b4ab9908cb355f5808178 (diff)
Merge tag 'efi-2026-01-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2026-01-rc3-2 CIL https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/28454 Documentation: * board: ti: am6254atl_sk: correct value of PRELOADED_BL33_BASE * pytest: fix u-boot-test-flash typo * samsung: Fix PXE description for the E850-96 board * board: ti: k3: Update TI firmware repository URL to GitHub * add missing macro descriptions to include/test/ut.h and add it to the API documenation * rearrange the description of DM tests and describe return values Testing: * Enable CI testing ACPI on qemu-riscv64_smode_acpi_defconfig * Add qemu-riscv64_smode_defconfig to the CI tests * Generalize tests such that they can run on RISC-V QEMU - fdt_test_apply requires CONFIG_OF_LIBFDT_OVERLAY - cmd/fdt: do not assume RNG device exists - cmd/bdinfo: make no flash assumption - cmd/bdinfo: consider arch_print_bdinfo() output - common/print: do not use fixed buffer addresses - cmd/fdt: do not use fixed buffer addresses - raise CONFIG_CONSOLE_RECORD_OUT_SIZE default to 0x6000 * enable CONFIG_CONSOLE_RECORD=y on qemu-riscv64_smode_acpi # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmkg1IsACgkQxIHbvCwF # GsQVLA//dmiApob+J9FUhD8joD+DaKSNfLYmv8zwfIFL2xRxx7D+CQT+r+I9FJYI # KojiLyn4PE/5VOm+wrsvAoYoMLJwAHvg5nmYJLLzvm6V//DLd1AEopP/+Uh8gEVW # xYGLcvDyGgZpraAhcmqRnAS89py3SigwGzhcUMbT6ZC6pgMVEsBpg8XeMpY7N05c # rwyqFAAPD8RcF7veQCpry87NiK5o+9YuM1zKl5sDFOpEWKq5ToNwhQ00bnux9lUd # HWz9X6ge58iFiMXRqUCnOaPeXeChn9ejyEiKtfQ0JtykOf9NT2WMdD2VKe9PCYsd # f7OynJTGG2OXTKBhon/xj75itiTm7EELc/FHwHEdtZIIHgpi/C33yQgKxLf9mtUo # Z7DKYpPoaTCbJhs9LCK942KPtshbtAJLKTVqyBPo7Jn0mneeCQUsbaQRU7JruJTK # hKluUjsAry3Do3wv/w6B8R6MMgfpBktPkqjg9e/maSdhYdkNAYpjajtORgpqmJRV # HTGJXfL3qFC50jlenlMYOm4Qake33MIMzubaxoM3j5ENDUJ7KAbWADEoWDpve8Tu # b/fX8uuW+g2T18Y/M9Bsk/jaUjDTx0xtZUSYNIIQJFDaJMzUxGYWlmtXhLZwFU8g # 7S5pBmgxoSAtQSMAeoJPJp9FSgXYqiGLUeSwcOH2NaPn0lLFvK0= # =D0Yy # -----END PGP SIGNATURE----- # gpg: Signature made Fri 21 Nov 2025 03:07:23 PM CST # gpg: using RSA key 6DC4F9C71F29A6FA06B76D33C481DBBC2C051AC4 # gpg: Good signature from "Heinrich Schuchardt <[email protected]>" [unknown] # gpg: aka "[jpeg image of size 1389]" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6DC4 F9C7 1F29 A6FA 06B7 6D33 C481 DBBC 2C05 1AC4
Diffstat (limited to 'include/test')
-rw-r--r--include/test/ut.h159
1 files changed, 132 insertions, 27 deletions
diff --git a/include/test/ut.h b/include/test/ut.h
index be5502e03a1..6510c35997f 100644
--- a/include/test/ut.h
+++ b/include/test/ut.h
@@ -130,18 +130,28 @@ int ut_check_console_end(struct unit_test_state *uts);
*
* This only supports a byte dump.
*
- * @total_bytes: Size of the expected dump in bytes`
- * Return: 0 if OK (looks like a dump and the length matches), other value on
- * error
+ * @uts: Test state
+ * @total_bytes: Size of the expected dump in bytes
+ * Return: 0 if OK (looks like a dump and the length matches),
+ * other value on error
*/
int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
-/* Report a failure, with printf() string */
+/**
+ * ut_report() - Report a failure, with printf() string
+ *
+ * @fmt: format string
+ * @args: arguments to be printed
+ */
#define ut_reportf(fmt, args...) \
ut_failf(uts, __FILE__, __LINE__, __func__, "report", \
fmt, ##args)
-/* Assert that a condition is non-zero */
+/**
+ * ut_assert() - Assert that a condition is true (not 0)
+ *
+ * @cond: condition
+ */
#define ut_assert(cond) ({ \
int __ret = 0; \
\
@@ -152,7 +162,13 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that a condition is non-zero, with printf() string */
+/**
+ * ut_assertf() - Assert that a condition is true with printf string
+ *
+ * @cond: condition
+ * @fmt: format string
+ * @args: arguments to be printed
+ */
#define ut_assertf(cond, fmt, args...) ({ \
int __ret = 0; \
\
@@ -164,7 +180,12 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that two int expressions are equal */
+/**
+ * ut_asserteq() - Assert that two int32 expressions are equal
+ *
+ * @expr1: expected value
+ * @expr2: actual value
+ */
#define ut_asserteq(expr1, expr2) ({ \
unsigned int _val1 = (expr1), _val2 = (expr2); \
int __ret = 0; \
@@ -179,7 +200,12 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that two 64 int expressions are equal */
+/**
+ * ut_asserteq_64() - Assert that two int64 expressions are equal
+ *
+ * @expr1: expected value
+ * @expr2: actual value
+ */
#define ut_asserteq_64(expr1, expr2) ({ \
u64 _val1 = (expr1), _val2 = (expr2); \
int __ret = 0; \
@@ -197,7 +223,12 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that two string expressions are equal */
+/**
+ * ut_asserteq_str() - Assert that two string expressions are equal
+ *
+ * @expr1: expected value
+ * @expr2: actual value
+ */
#define ut_asserteq_str(expr1, expr2) ({ \
const char *_val1 = (expr1), *_val2 = (expr2); \
int __ret = 0; \
@@ -211,9 +242,12 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/*
- * Assert that two string expressions are equal, up to length of the
- * first
+/**
+ * ut_asserteq_strn() - Assert that two string expressions are equal
+ * up to the length of the first expression
+ *
+ * @expr1: expected value
+ * @expr2: actual value
*/
#define ut_asserteq_strn(expr1, expr2) ({ \
const char *_val1 = (expr1), *_val2 = (expr2); \
@@ -230,7 +264,13 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that two memory areas are equal */
+/**
+ * ut_asserteq_mem() - Assert that two memory areas are equal
+ *
+ * @expr1: expected value
+ * @expr2: actual value
+ * @len: length of the memory areas
+ */
#define ut_asserteq_mem(expr1, expr2, len) ({ \
const u8 *_val1 = (u8 *)(expr1), *_val2 = (u8 *)(expr2); \
const uint __len = len; \
@@ -250,7 +290,12 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that two pointers are equal */
+/**
+ * ut_asserteq_ptr() - Assert that two string pointers are equal
+ *
+ * @expr1: expected value
+ * @expr2: actual value
+ */
#define ut_asserteq_ptr(expr1, expr2) ({ \
const void *_val1 = (expr1), *_val2 = (expr2); \
int __ret = 0; \
@@ -264,7 +309,13 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that two addresses (converted from pointers) are equal */
+/**
+ * ut_asserteq_addr() - Assert that two addresses (converted from pointers)
+ * are equal
+ *
+ * @expr1: expected value
+ * @expr2: actual value
+ */
#define ut_asserteq_addr(expr1, expr2) ({ \
ulong _val1 = map_to_sysmem(expr1); \
ulong _val2 = map_to_sysmem(expr2); \
@@ -279,7 +330,11 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that a pointer is NULL */
+/**
+ * ut_assertnull() - Assert that a pointer is NULL
+ *
+ * @expr: pointer
+ */
#define ut_assertnull(expr) ({ \
const void *_val = (expr); \
int __ret = 0; \
@@ -293,7 +348,11 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that a pointer is not NULL */
+/**
+ * ut_assertnonnull() - Assert that a pointer is not NULL
+ *
+ * @expr: pointer
+ */
#define ut_assertnonnull(expr) ({ \
const void *_val = (expr); \
int __ret = 0; \
@@ -307,7 +366,11 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that a pointer is not an error pointer */
+/**
+ * ut_assertok_ptr() - Assert that a pointer is not an error pointer
+ *
+ * @expr: pointer
+ */
#define ut_assertok_ptr(expr) ({ \
const void *_val = (expr); \
int __ret = 0; \
@@ -322,10 +385,19 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that an operation succeeds (returns 0) */
+/**
+ * ut_assertok() - Assert that an operation succeeds (returns 0)
+ *
+ * @cond: expression
+ */
#define ut_assertok(cond) ut_asserteq(0, cond)
-/* Assert that the next console output line matches */
+/**
+ * ut_assert_nextline() - Assert that the next console output line matches
+ *
+ * @fmt: format string
+ * @args: print arguments
+ */
#define ut_assert_nextline(fmt, args...) ({ \
int __ret = 0; \
\
@@ -338,7 +410,13 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that the next console output line matches up to the length */
+/**
+ * ut_assert_nextlinen() - Assert that the next console output line matches
+ * up to the length of the expected string.
+ *
+ * @fmt: format string
+ * @args: print arguments
+ */
#define ut_assert_nextlinen(fmt, args...) ({ \
int __ret = 0; \
\
@@ -351,7 +429,10 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that there is a 'next' console output line, and skip it */
+/**
+ * ut_assert_skipline() - Assert that there is a 'next' console output line,
+ * and skip it
+ */
#define ut_assert_skipline() ({ \
int __ret = 0; \
\
@@ -363,7 +444,13 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that a following console output line matches */
+/**
+ * ut_assert_skip_to_line() - Assert that a following console output line
+ * matches
+ *
+ * @fmt: format string
+ * @args: print arguments
+ */
#define ut_assert_skip_to_line(fmt, args...) ({ \
int __ret = 0; \
\
@@ -376,7 +463,13 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that a following console output line matches */
+/**
+ * ut_assert_skip_to_linen() - Assert that a following console output line
+ * matches up to the length of the expected string
+ *
+ * @fmt: format string
+ * @args: print arguments
+ */
#define ut_assert_skip_to_linen(fmt, args...) ({ \
int __ret = 0; \
\
@@ -389,7 +482,9 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that there is no more console output */
+/**
+ * ut_assert_console_end() - Assert that there is no more console output
+ */
#define ut_assert_console_end() ({ \
int __ret = 0; \
\
@@ -402,7 +497,12 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that the next lines are print_buffer() dump at an address */
+/**
+ * ut_assert_nextlines_are_dump - Assert that the next lines are print_buffer()
+ * dump at an address
+ *
+ * @total_bytes: Size of the expected dump in bytes
+ */
#define ut_assert_nextlines_are_dump(total_bytes) ({ \
int __ret = 0; \
\
@@ -416,7 +516,10 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
__ret; \
})
-/* Assert that the next console output line is empty */
+/**
+ * ut_assert_nextline_empty() - Assert that the next console output line is
+ * empty
+ */
#define ut_assert_nextline_empty() \
ut_assert_nextline("%s", "")
@@ -451,6 +554,8 @@ void ut_silence_console(struct unit_test_state *uts);
*
* This restarts console output again and turns off console recording. This
* happens on all boards, including sandbox.
+ *
+ * @uts: Test state
*/
void ut_unsilence_console(struct unit_test_state *uts);