Files
u-boot/doc/develop
Simon Glass 2b6e3394fb test: Add documentation for test parameters
Add a description of how test parameters work. This helps to make it
easier to write C tests which need setup to be done in Python.

Series-to: concept
Series-cc: heinrich
Cover-letter:
test: Add support for passing arguments to C unit tests
This series adds infrastructure for passing runtime arguments from Python
tests to C unit tests. This makes it easier to support a hybrid testing
approach where Python handles complex setup (filesystem images,
environment configuration) while C handles the actual test logic with
better debuggability.

A few other things are included to make this work:

- A fix for linker list alignment that was causing garbage values like
  "Running -858993444 bloblist tests" due to GCC's magic-number division
  optimization failing when padding breaks exact multiples

- A fix fix for serial output with sandbox, since it sometimes misses
  output at the end when running tests with gnome terminal

- Improvements to the linker-list script to detect padding and
  pointer-arithmetic bugs

- A new UNIT_TEST_ARGS() macro for declaring tests with typed arguments,
  along with argument parsing in the ut command (name=value format)

- Argument-accessor macros ut_str(), ut_int(), and ut_bool() with
  type-checking and bounds validation

- A private buffer (uts->priv) for test-local temporary data, which
  makes it a little easier to write shorter tests

- Tests for the argument feature (test_args) covering type checking,
  bounds checking, and argument-parsing failures

As an example, the basic filesystem tests are converted from pure Python
to C with Python wrappers.

Some improved printf documentation and support for Linux's %pV format
are provided.

The slight increase in size causes qemu-riscv64_spl to fail, so this
series also includes a patch to increase the SPL-malloc() space.
END

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-14 09:52:56 -07:00
..
2025-05-29 19:06:30 +01:00
2025-11-24 06:47:19 -07:00
2025-06-09 06:36:15 -06:00
2025-12-01 17:04:37 +00:00
2025-09-04 07:08:24 -06:00
2025-05-29 19:06:30 +01:00
2025-05-16 18:50:25 +02:00
2025-09-11 15:19:22 -06:00