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 14:13:44 -0600	[thread overview]
Message-ID: <20260413201344.GF41863@bill-the-cat> (raw)
In-Reply-To: <20260412111958.943933-1-sjg@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 2514 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:

You still need to work on explaining your changes in a positive manner.

> - Python lacks access to things like return codes and has to scan the
>   console output to figure out what happened

Pro: Python exercises things the way users exercise them and so exposes
deficiencies in our user interface as well, when applicable.

> - Python lacks access to internal state, so it cannot directly check
>   the result of an operation

It's unclear when that is, or is not a problem and when tests that do
check intermediate state are providing value.

> - Python is ~100x slower due to console interaction, etc.

Again, maybe you should go back to your suggestion of several years ago
to see about addressing that, as the tests themselves are not slow, it's
the pipe? Our brave new AI powered world runs on Python handing stuff
off and getting it back super quickly.

> - 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

All things that may or may not be problems for other people, or are
intentional choices as they again test the system the way it's used.
Using gdb attached to u-boot in the other terminal where you're running
breaking things sounds like a reasonable debug path to me. And having
unit tests calling in to functions is why today we have a lot of things
not marked as "static" and so not being optimized as well as they could
by the compiler, which is its own set of trade-offs and not an automatic
good thing and design win.

[snip]
>  16 files changed, 1437 insertions(+), 279 deletions(-)

All of which is to say, you need to explain yourself in a positive, not
negative or oppositional way. Otherwise this reads like "I don't like
what we do now, here's a bunch of change to what I like instead".

-- 
Tom

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

  parent reply	other threads:[~2026-04-13 20:13 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 ` [PATCH v2 00/12] test: Add support for passing arguments to C unit tests Tom Rini
2026-04-13 15:40   ` Simon Glass
2026-04-13 20:13 ` Tom Rini [this message]
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=20260413201344.GF41863@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