public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Simon Glass <sjg@chromium.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>,
	Alexander Gendin <agendin@matrox.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Francis Laniel <francis.laniel@amarulasolutions.com>,
	Guillaume La Roque <glaroque@baylibre.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ion Agorria <ion@agorria.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Jerome Forissier <jerome.forissier@linaro.org>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Julien Masson <jmasson@baylibre.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Marek Vasut <marex@denx.de>,
	Massimiliano Minella <massimiliano.minella@se.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Rasmus Villemoes <ravi@prevas.dk>,
	Ravi Minnikanti <rminnikanti@marvell.com>,
	Raymond Mao <raymond.mao@linaro.org>,
	Richard Weinberger <richard@nod.at>,
	Stephen Carlson <stcarlso@linux.microsoft.com>,
	Stephen Warren <swarren@nvidia.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Sughosh Ganu <sughosh.ganu@linaro.org>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	Tim Harvey <tharvey@gateworks.com>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH 00/43] test: Improvements to ut command and test-suite running
Date: Thu, 16 Jan 2025 10:46:59 +0100	[thread overview]
Message-ID: <87a5br850s.fsf@baylibre.com> (raw)
In-Reply-To: <20250115133114.590375-1-sjg@chromium.org>

Hi Simon,

Thank you for the series.

On mer., janv. 15, 2025 at 06:30, Simon Glass <sjg@chromium.org> wrote:

> The current method of running unit tests relies on subcommands of the
> ut command. Only the code in each subcommand knows how to find the tests
> related to that subcomand.
>
> This is not ideal and we now have quite a few subcommands which do
> nothing but locate the relevant tests in a linker list, then call a
> common function to run them.
>
> This series adds a list of test suites, so that these subcommands can be
> removed.
>
> An issue with 'ut all' is that it doesn't record how many tests failed
> overall, so it is necessary to examine copious amounts of output to look
> for failures. This series adds a new 'total' feature allow recording the
> total number of failed tests.
>
> To help with 'ut all' a new pytest is created which runs it (as well as
> 'ut info') and makes sure that all is well. Due to the 'ut all' failures
> this does not pass, so the test is disabled for now. It is here because
> it provides security against misnaming a test suite and causing it not
> to run.

I wanted to test this, but it seems it does not apply on both master or
next:

With master: 178f6ecb21fe ("Merge patch series "bootstd: Support recording images"")
With next: d6da3dbaef57 ("Merge patch series "cmd: Add support for optee commands."")

When running:
$ b4 shazam -s -l --check 20250115133114.590375-1-sjg@chromium.org

I see:

"""
[...] snip

Total patches: 43
---
Applying: test: Drop unused suite prototypes
Applying: test: Rename test_get_state() to ut_get_state()
Applying: test: Add functions to init and uninit the test state
Applying: test: Pass the test-state into ut_run_list()
Applying: Improve support for linker lists in data structures
Applying: test: Add newlines to hush-test messages
Applying: test: Rename test suites to match their linker-list name
Applying: test: Update ut info to show suites
Applying: test/py: Add a test which runs all unit tests
Applying: test: Drop the _test suffix on linker lists
Applying: test: Introduce a better array of test suites
Patch failed at 0011 test: Introduce a better array of test suites
error: sha1 information is lacking or useless (test/cmd_ut.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
"""

On what base should this be applied if we want to test this?
Sorry if this is a sily question, usually I get dependencies from the
cover letter but I could not find any here.

>
> Future work may:
> - get 'ut all' passing
> - enable test_suite() in CL, to ensure that 'ut all' keeps passing
> - record duration of each suite
> - allow running the tests in random order to tease out dependencies
> - tweak the output to remove common prefixes
> - getting rid of bootstd, optee and seame 'ut' subcommands
>
>
> Simon Glass (43):
>   test: Drop unused suite prototypes
>   test: Rename test_get_state() to ut_get_state()
>   test: Add functions to init and uninit the test state
>   test: Pass the test-state into ut_run_list()
>   Improve support for linker lists in data structures
>   test: Add newlines to hush-test messages
>   test: Rename test suites to match their linker-list name
>   test: Update ut info to show suites
>   test/py: Add a test which runs all unit tests
>   test: Drop the _test suffix on linker lists
>   test: Introduce a better array of test suites
>   test: Drop the function for running bdinfo tests
>   test: Drop the function for running cmd tests
>   test: Drop the function for running common tests
>   test: Drop the function for running dm tests
>   test: Drop the function for running env tests
>   test: Drop the function for running exit tests
>   test: Drop the function for running fdt tests
>   test: Drop the function for running font tests
>   test: Drop the function for running lib tests
>   test: Drop the function for running log tests
>   test: Drop the function for running mbr tests
>   test: Drop the function for running mem tests
>   test: Drop the function for running setexpr tests
>   test: Drop the function for running measurement tests
>   test: Drop the function for running bloblist tests
>   test: Drop the function for running bootm tests
>   test: Drop the function for running addrmap tests
>   test: Drop the function for running hush tests
>   test: Drop the function for running loadm tests
>   test: Drop the function for running pci_mps tests
>   test: Drop the function for running seama tests
>   test: Drop the function for running upl tests
>   test: Drop the info test from the list
>   test: Drop conditional compilation for suites
>   test: Pass the test state to cmd_ut_category()
>   test: Move stats into a struct
>   test: Keep a track of the numbers of tests run
>   test: Move stat-printing into its own function
>   test: Record and show the totals for all test runs
>   test: Sort the test suites
>   test: Disable test_suite
>   test: Move help into the suite declaration
>
>  arch/sandbox/cpu/spl.c        |   6 +-
>  include/dm/test.h             |   2 +-
>  include/linker_lists.h        |  51 +++++
>  include/test/cmd.h            |   2 +-
>  include/test/common.h         |   2 +-
>  include/test/env.h            |   2 +-
>  include/test/hush.h           |   2 +-
>  include/test/lib.h            |   2 +-
>  include/test/log.h            |   4 +-
>  include/test/optee.h          |   2 +-
>  include/test/overlay.h        |   2 +-
>  include/test/suites.h         |  53 ++---
>  include/test/test.h           |  23 ++-
>  include/test/ut.h             |  45 ++++-
>  test/boot/bootm.c             |  11 +-
>  test/boot/bootstd_common.c    |   9 +-
>  test/boot/bootstd_common.h    |   3 +-
>  test/boot/measurement.c       |  12 +-
>  test/boot/upl.c               |  11 +-
>  test/cmd/Makefile             |   4 +-
>  test/cmd/addrmap.c            |  11 +-
>  test/cmd/bdinfo.c             |  10 +-
>  test/cmd/cmd_ut_cmd.c         |  20 --
>  test/cmd/exit.c               |  11 +-
>  test/cmd/fdt.c                |  10 +-
>  test/cmd/font.c               |  10 +-
>  test/cmd/loadm.c              |  11 +-
>  test/cmd/mbr.c                |  10 +-
>  test/cmd/mem.c                |  19 --
>  test/cmd/mem_copy.c           |   2 +-
>  test/cmd/mem_search.c         |   2 +-
>  test/cmd/pci_mps.c            |  12 +-
>  test/cmd/seama.c              |  11 +-
>  test/cmd/setexpr.c            |  11 +-
>  test/cmd_ut.c                 | 361 +++++++++++++++++++++-------------
>  test/common/Makefile          |   1 -
>  test/common/bloblist.c        |  12 +-
>  test/common/cmd_ut_common.c   |  21 --
>  test/dm/Makefile              |   2 -
>  test/dm/test-dm.c             |  16 --
>  test/dm/test-driver.c         |  10 +-
>  test/dm/test-uclass.c         |   8 +-
>  test/env/cmd_ut_env.c         |  10 -
>  test/hush/Makefile            |   1 -
>  test/hush/cmd_ut_hush.c       |  19 --
>  test/hush/dollar.c            |   7 +-
>  test/hush/loop.c              |   4 +-
>  test/lib/Makefile             |   1 -
>  test/lib/cmd_ut_lib.c         |  19 --
>  test/log/Makefile             |   2 -
>  test/log/log_ut.c             |  20 --
>  test/optee/cmd_ut_optee.c     |   4 +-
>  test/overlay/cmd_ut_overlay.c |  14 +-
>  test/py/conftest.py           |   7 +-
>  test/py/tests/test_spl.py     |   2 +-
>  test/py/tests/test_suite.py   | 182 +++++++++++++++++
>  test/py/tests/test_upl.py     |   2 +-
>  test/py/tests/test_ut.py      |   2 +-
>  test/py/tests/test_vbe.py     |   2 +-
>  test/py/tests/test_vpl.py     |   2 +-
>  test/test-main.c              | 104 ++++++----
>  test/ut.c                     |   4 +-
>  62 files changed, 657 insertions(+), 580 deletions(-)
>  delete mode 100644 test/cmd/cmd_ut_cmd.c
>  delete mode 100644 test/cmd/mem.c
>  delete mode 100644 test/common/cmd_ut_common.c
>  delete mode 100644 test/dm/test-dm.c
>  delete mode 100644 test/hush/cmd_ut_hush.c
>  delete mode 100644 test/lib/cmd_ut_lib.c
>  delete mode 100644 test/log/log_ut.c
>  create mode 100644 test/py/tests/test_suite.py
>
> -- 
> 2.34.1

  parent reply	other threads:[~2025-01-16  9:47 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15 13:30 [PATCH 00/43] test: Improvements to ut command and test-suite running Simon Glass
2025-01-15 13:30 ` [PATCH 01/43] test: Drop unused suite prototypes Simon Glass
2025-01-15 13:30 ` [PATCH 02/43] test: Rename test_get_state() to ut_get_state() Simon Glass
2025-01-15 13:30 ` [PATCH 03/43] test: Add functions to init and uninit the test state Simon Glass
2025-01-15 13:30 ` [PATCH 04/43] test: Pass the test-state into ut_run_list() Simon Glass
2025-01-15 13:30 ` [PATCH 05/43] Improve support for linker lists in data structures Simon Glass
2025-01-15 13:30 ` [PATCH 06/43] test: Add newlines to hush-test messages Simon Glass
2025-01-15 13:30 ` [PATCH 07/43] test: Rename test suites to match their linker-list name Simon Glass
2025-01-15 13:30 ` [PATCH 08/43] test: Update ut info to show suites Simon Glass
2025-01-15 13:30 ` [PATCH 09/43] test/py: Add a test which runs all unit tests Simon Glass
2025-01-15 13:30 ` [PATCH 10/43] test: Drop the _test suffix on linker lists Simon Glass
2025-01-15 13:30 ` [PATCH 11/43] test: Introduce a better array of test suites Simon Glass
2025-01-15 13:30 ` [PATCH 12/43] test: Drop the function for running bdinfo tests Simon Glass
2025-01-15 13:30 ` [PATCH 13/43] test: Drop the function for running cmd tests Simon Glass
2025-01-15 13:30 ` [PATCH 14/43] test: Drop the function for running common tests Simon Glass
2025-01-15 13:30 ` [PATCH 15/43] test: Drop the function for running dm tests Simon Glass
2025-01-15 13:30 ` [PATCH 16/43] test: Drop the function for running env tests Simon Glass
2025-01-15 13:30 ` [PATCH 17/43] test: Drop the function for running exit tests Simon Glass
2025-01-15 13:30 ` [PATCH 18/43] test: Drop the function for running fdt tests Simon Glass
2025-01-15 13:30 ` [PATCH 19/43] test: Drop the function for running font tests Simon Glass
2025-01-15 13:30 ` [PATCH 20/43] test: Drop the function for running lib tests Simon Glass
2025-01-15 13:30 ` [PATCH 21/43] test: Drop the function for running log tests Simon Glass
2025-01-15 13:30 ` [PATCH 22/43] test: Drop the function for running mbr tests Simon Glass
2025-01-15 13:30 ` [PATCH 23/43] test: Drop the function for running mem tests Simon Glass
2025-01-15 13:30 ` [PATCH 24/43] test: Drop the function for running setexpr tests Simon Glass
2025-01-15 13:30 ` [PATCH 25/43] test: Drop the function for running measurement tests Simon Glass
2025-01-15 13:30 ` [PATCH 26/43] test: Drop the function for running bloblist tests Simon Glass
2025-01-15 13:30 ` [PATCH 27/43] test: Drop the function for running bootm tests Simon Glass
2025-01-15 13:30 ` [PATCH 28/43] test: Drop the function for running addrmap tests Simon Glass
2025-01-15 13:30 ` [PATCH 29/43] test: Drop the function for running hush tests Simon Glass
2025-01-15 13:31 ` [PATCH 30/43] test: Drop the function for running loadm tests Simon Glass
2025-01-15 13:31 ` [PATCH 31/43] test: Drop the function for running pci_mps tests Simon Glass
2025-01-15 13:31 ` [PATCH 32/43] test: Drop the function for running seama tests Simon Glass
2025-01-15 13:31 ` [PATCH 33/43] test: Drop the function for running upl tests Simon Glass
2025-01-15 13:31 ` [PATCH 34/43] test: Drop the info test from the list Simon Glass
2025-01-15 13:31 ` [PATCH 35/43] test: Drop conditional compilation for suites Simon Glass
2025-01-15 13:31 ` [PATCH 36/43] test: Pass the test state to cmd_ut_category() Simon Glass
2025-01-15 13:31 ` [PATCH 37/43] test: Move stats into a struct Simon Glass
2025-01-15 13:31 ` [PATCH 38/43] test: Keep a track of the numbers of tests run Simon Glass
2025-01-15 13:31 ` [PATCH 39/43] test: Move stat-printing into its own function Simon Glass
2025-01-15 13:31 ` [PATCH 40/43] test: Record and show the totals for all test runs Simon Glass
2025-01-15 13:31 ` [PATCH 41/43] test: Sort the test suites Simon Glass
2025-01-15 13:31 ` [PATCH 42/43] test: Disable test_suite Simon Glass
2025-01-15 13:31 ` [PATCH 43/43] test: Move help into the suite declaration Simon Glass
2025-01-15 15:32 ` [PATCH 00/43] test: Improvements to ut command and test-suite running Heinrich Schuchardt
2025-01-16  1:26   ` Simon Glass
2025-01-16  9:46 ` Mattijs Korpershoek [this message]
2025-01-16 15:49   ` 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=87a5br850s.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=agendin@matrox.com \
    --cc=andrew.goodbody@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=francis.laniel@amarulasolutions.com \
    --cc=glaroque@baylibre.com \
    --cc=ion@agorria.com \
    --cc=jens.wiklander@linaro.org \
    --cc=jerome.forissier@linaro.org \
    --cc=jmasson@baylibre.com \
    --cc=joe.hershberger@ni.com \
    --cc=linus.walleij@linaro.org \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marex@denx.de \
    --cc=massimiliano.minella@se.com \
    --cc=michael@amarulasolutions.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=ravi@prevas.dk \
    --cc=raymond.mao@linaro.org \
    --cc=richard@nod.at \
    --cc=rminnikanti@marvell.com \
    --cc=sjg@chromium.org \
    --cc=stcarlso@linux.microsoft.com \
    --cc=sughosh.ganu@linaro.org \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --cc=tharvey@gateworks.com \
    --cc=trini@konsulko.com \
    --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