public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Marek Vasut <marex@denx.de>
Subject: Re: [PATCH v2 00/12] test: Add support for passing arguments to C unit tests
Date: Mon, 13 Apr 2026 09:29:54 -0600	[thread overview]
Message-ID: <20260413152954.GW41863@bill-the-cat> (raw)
In-Reply-To: <20260412111958.943933-1-sjg@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 2663 bytes --]

On Sun, Apr 12, 2026 at 05:19:37AM -0600, Simon Glass wrote:

> Some tests have two parts: a Python test which handles setup, such as
> creating filesystem images or configuring the environment, and a C
> test which does the bulk of the work including assertions. At present
> there is no way to pass information between these two parts, so
> things like paths and device names must be hard-coded in the C test.
> 
> This tends to make people write tests in Python, but this is not ideal
> for several reasons:
> 
> - Python lacks access to things like return codes and has to scan the
>   console output to figure out what happened
> - Python lacks access to internal state, so it cannot directly check
>   the result of an operation
> - Python is ~100x slower due to console interaction, etc.
> - C tests can be stepped through in gdb, which is much harder with
>   Python driving the console
> - C tests can exercise internal APIs directly (e.g. fs_read(),
>   fs_size()) rather than going through the command layer, so they
>   test more precisely what they intend to
> 
> This series adds infrastructure for passing typed, runtime arguments
> from Python to C unit tests, using a name=value format on the ut
> command line.
> 
> The series includes:
> 
> - Regex assertion helpers for matching variable output in tests
> 
> - A private buffer in unit_test_state for test-local temporary data
> 
> - Argument-type definitions (string, integer, boolean) with optional
>   flags and default values
> 
> - A new UNIT_TEST_ARGS() macro for declaring tests with typed
>   arguments
> 
> - Argument parsing in the test framework, accepting name=value format
> 
> - Updates to the ut command to pass arguments through to tests
> 
> - Type-checked accessor macros ut_str(), ut_int(), and ut_bool()
>   with bounds validation
> 
> - Tests for the argument feature covering type checking, optional
>   arguments, and argument-parsing failures
> 
> - Documentation for the test-parameter feature
> 
> - C-based filesystem tests as an example of the hybrid approach,
>   with Python wrappers that pass filesystem type, image path, and
>   expected MD5 values to the C tests
> 
> Note: This series depends on:
> 
>    https://patchwork.ozlabs.org/project/uboot/list/?series=496972
> 
> Changes in v2:
> - Correct double signoff

Reposting a series this large, on the weekend, the day after v1, because
you made a trivial mistake is bad form. You should just acknowledge that
in the cover letter and wait for feedback.

And since I'm seeing over 100 emails from you this weekend, this
matters.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2026-04-13 15:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-12 11:19 [PATCH v2 00/12] test: Add support for passing arguments to C unit tests Simon Glass
2026-04-12 11:19 ` [PATCH v2 01/12] test: Add ut_asserteq_regex() for regex pattern matching Simon Glass
2026-04-12 11:19 ` [PATCH v2 02/12] test: Add a helper to check the next line against a regex Simon Glass
2026-04-12 11:19 ` [PATCH v2 03/12] test: Add a private buffer for tests Simon Glass
2026-04-12 11:19 ` [PATCH v2 04/12] test: Add argument-type definitions Simon Glass
2026-04-12 11:19 ` [PATCH v2 05/12] test: Add a macro to declare unit tests with arguments Simon Glass
2026-04-12 11:19 ` [PATCH v2 06/12] test: Add support for passing arguments to C tests Simon Glass
2026-04-12 11:19 ` [PATCH v2 07/12] test: Enhance the ut command to pass test arguments Simon Glass
2026-04-12 11:19 ` [PATCH v2 08/12] test: Add type-checked argument accessor functions Simon Glass
2026-04-12 11:19 ` [PATCH v2 09/12] test: Add tests for unit-test arguments Simon Glass
2026-04-12 11:19 ` [PATCH v2 10/12] test: Add documentation for the test framework Simon Glass
2026-04-12 11:19 ` [PATCH v2 11/12] test: fs: add C-based filesystem tests Simon Glass
2026-04-12 11:19 ` [PATCH v2 12/12] test: fs: Update Python tests to call C implementations Simon Glass
2026-04-13 15:29 ` Tom Rini [this message]
2026-04-13 15:40   ` [PATCH v2 00/12] test: Add support for passing arguments to C unit tests Simon Glass
2026-04-13 20:13 ` Tom Rini
2026-04-16 17:42   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260413152954.GW41863@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=andrew.goodbody@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=marex@denx.de \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox