From: David Gibson <david@gibson.dropbear.id.au>
To: Herve Codina <herve.codina@bootlin.com>
Cc: Simon Glass <sjg@chromium.org>,
Devicetree Compiler <devicetree-compiler@vger.kernel.org>
Subject: Re: [PATCH v3 1/4] tests: Check the message when dtc fails
Date: Sat, 31 Oct 2026 14:36:42 +1100 [thread overview]
Message-ID: <auViQZqdLhTbnaME@gractus.seuss> (raw)
In-Reply-To: <20261030104011.7bf119be@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 4361 bytes --]
On Fri, Oct 30, 2026 at 10:40:11AM +0100, Herve Codina wrote:
> Hi,
>
> On Fri, 30 Oct 2026 14:36:22 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
>
> ...
>
> > > > @@ -319,7 +322,8 @@ libfdt_overlay_tests () {
> > > > run_dtc_test -I dts -O dtb -o $tree.test.dtb "$SRCDIR/$tree.dts"
> > > > run_test overlay_bad_fixup overlay_base_manual_symbols.test.dtb $tree.test.dtb
> > > > done
> > > > - run_sh_test "$SRCDIR/dtc-fatal.sh" -I dts -O dtb -o /dev/null "$SRCDIR/fixup-ref-to-path.dts"
> > > > + run_wrap_error_msg_test "Can't generate fixup for reference to path" \
> > > > + $VALGRIND $DTC -I dts -O dtb -o /dev/null "$SRCDIR/fixup-ref-to-path.dts"
> > >
> > > I don't think that the $VALGRIND here is a good idea. Also this is not consistent
> > > with other dtc test calls. Those tests calls (other than using a script) use
> > > run_dtc_test(). run_dtc_test() use $VALGRIND internally.
> >
> > So, this is reminding me why I think dtc-fatal.sh existed in the first
> > place:
> > 1. We want to wrap all dtc invocations in $VALGRIND
> >
> > 2. We don't want to use valgrind on other commands we invoke via
> > wrap_error
> >
> > 3. We want to avoid individual test invocations from dealing with
> > $VALGRIND
> >
> > Hence, two different wrappers: run_wrap_error_test for general
> > commands, dtc-fatal.sh for errors from dtc specifically. Why one is a
> > function and one a separate script I don't recall, although I have a
> > nasty feeling there might have been a particular reason for having the
> > script, though I've forgotten what it might have been.
> >
> > I can think of one more modern reason to prefer scripts over shell
> > functions: the current integration of run_tests.sh into meson is
> > pretty ugly. Rather than using meson to manage testcases (which it
> > can do reasonably well), we just invoke each "set" of tests from
> > run-tests.sh as a single meson testcase. That means more levels of
> > logs to figure out exactly what went wrong for a meson test failure.
> >
> > At some point it might be nice to eliminate run_tests.sh and make the
> > testsuite meson native. For that, shell function wrappers are
> > obviously not ideal.
>
> Have you consider switching current tests to TAP (Test Anything Protocol)?
>
> TAP is supported by meson test.
Sort of. Using TAP for this would, IMO, negate one of the big
advantages of moving to meson tests - being able to easily run
specific test cases. Indeed, I'm not overly fond of TAP in general -
I'd be more likely to try converting to exeter[0].
[0] https://www.youtube.com/watch?v=4yKwN9u33TI
> If at some point the plan is to move current tests to a a better meson
> integration, I suggest to consider TAP. Indeed, this will allow a finer
> grain in test results compared to a meson basic executable test.
Uh.. how so?
> We can move tests from current tests to TAP by parts to ease this moving
> task.
I don't see how TAP really makes an incremental conversion any easier.
> run_test.sh can provide its output in TAP format.
>
> Cleaner test harnesses are create step by step by extracting parts from
> run_test.sh until run_test.sh is empty.
>
> Also all new tests should be TAP tests.
>
> Libraries exist to help building TAP tests. One lib to chose for C test
> program (if they are run out of a test shell script) and an other for
> Shell test scripts should be enough.
I'm aware,.
> > The split between patches 1 & 2 here isn't ideal, btw. The VALGRIND
> > behaviour change is correct, but not logicall connected to the
> > run_wrap_error_test / dtc-fatal.sh consolidation. Meanwhile removing
> > dtc-fatal.sh _does_ belong with the patch that makes it possible
> > (given that's a single fairly small patch).
> >
> > So, where next.
> >
> > I think keep dtc-fatal.sh for the time being, but extend it with the
> > -m option to check for specific messages. Consider moving
> > run_wrap_error_test into its own script (which dtc-fatal.sh could
> > call).
>
> Ok.
>
> Best regards,
> Hervé
>
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-10-31 5:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 9:30 [PATCH v3 0/4] dtc: Check fatal error messages and document deletes Simon Glass
2026-10-29 9:30 ` [PATCH v3 1/4] tests: Check the message when dtc fails Simon Glass
2026-10-29 11:11 ` Herve Codina
2026-10-30 3:36 ` David Gibson
2026-10-30 9:40 ` Herve Codina
2026-10-31 3:36 ` David Gibson [this message]
2026-11-03 7:08 ` Herve Codina
2026-11-03 7:21 ` David Gibson
2026-10-29 9:30 ` [PATCH v3 2/4] tests: Drop dtc-fatal.sh Simon Glass
2026-10-29 9:30 ` [PATCH v3 3/4] doc: dts-format: Describe later definitions and deletes Simon Glass
2026-10-29 11:28 ` Herve Codina
2026-10-30 3:11 ` David Gibson
2026-10-29 9:30 ` [PATCH v3 4/4] doc: dts-format: Correct what happens without /dts-v1/ Simon Glass
2026-10-29 11:33 ` Herve Codina
2026-10-30 3:15 ` David Gibson
2026-10-29 11:17 ` [PATCH v3 0/4] dtc: Check fatal error messages and document deletes Herve Codina
2026-10-30 3:16 ` David Gibson
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=auViQZqdLhTbnaME@gractus.seuss \
--to=david@gibson.dropbear.id.au \
--cc=devicetree-compiler@vger.kernel.org \
--cc=herve.codina@bootlin.com \
--cc=sjg@chromium.org \
/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