From: Herve Codina <herve.codina@bootlin.com>
To: David Gibson <david@gibson.dropbear.id.au>
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: Fri, 30 Oct 2026 10:40:11 +0100 [thread overview]
Message-ID: <20261030104011.7bf119be@bootlin.com> (raw)
In-Reply-To: <auQQtdKjywFWPe7D@gractus.seuss>
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.
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.
We can move tests from current tests to TAP by parts to ease this moving
task.
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.
>
> 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é
next prev parent reply other threads:[~2026-10-30 9:40 UTC|newest]
Thread overview: 14+ 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 [this message]
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=20261030104011.7bf119be@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=david@gibson.dropbear.id.au \
--cc=devicetree-compiler@vger.kernel.org \
--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