mbox series

[RFC,0/4] test-tool: add unit test suite runner

Message ID cover.1705443632.git.steadmon@google.com (mailing list archive)
Headers show
Series test-tool: add unit test suite runner | expand

Message

Josh Steadmon Jan. 16, 2024, 10:22 p.m. UTC
For various reasons (see discussion at [1]) we would like an alternative
to `prove` for running test suites (including the unit tests) on
Windows.

This series extends the existing `test-tool run-command testsuite` to
support running unit tests. In addition, it includes some small
cleanups: we move t-basic out of the unit-tests directory, and add a
test wrapper script to allow unit tests and the shell test suite to run
in a single `prove` process.

Some known remaining bits of work:
* We need to filter out cmake *.pdb files when running with `test-tool`.
* We should investigate switching the Windows CI to use `test-tool`
  instead of prove.
* We should determine whether it is confusing or otherwise harmful to
  people's workflow to have the unit tests run in parallel with shell
  tests when using prove as the default test target.

[1] https://lore.kernel.org/git/pull.1613.git.1699894837844.gitgitgadget@gmail.com/


Jeff King (1):
  t/Makefile: run unit tests alongside shell tests

Josh Steadmon (3):
  t0080: turn t-basic unit test into a helper
  test-tool run-command testsuite: support unit tests
  unit tests: add rule for running with test-tool

 Makefile                          | 19 +++++++++++----
 t/Makefile                        | 13 +++++++---
 t/helper/test-run-command.c       | 40 ++++++++++++++++++++++++-------
 t/run-test.sh                     | 13 ++++++++++
 t/t0080-unit-test-output.sh       | 24 +++++++++----------
 t/t0080/.gitignore                |  1 +
 t/{unit-tests => t0080}/t-basic.c |  2 +-
 7 files changed, 83 insertions(+), 29 deletions(-)
 create mode 100755 t/run-test.sh
 create mode 100644 t/t0080/.gitignore
 rename t/{unit-tests => t0080}/t-basic.c (98%)


base-commit: a26002b62827b89a19b1084bd75d9371d565d03c

Comments

Junio C Hamano Jan. 16, 2024, 11:24 p.m. UTC | #1
Josh Steadmon <steadmon@google.com> writes:

> For various reasons (see discussion at [1]) we would like an alternative
> to `prove` for running test suites (including the unit tests) on
> Windows.
>
> This series extends the existing `test-tool run-command testsuite` to
> support running unit tests. In addition, it includes some small
> cleanups: we move t-basic out of the unit-tests directory, and add a
> test wrapper script to allow unit tests and the shell test suite to run
> in a single `prove` process.
>
> Some known remaining bits of work:
> * We need to filter out cmake *.pdb files when running with `test-tool`.

;-)

I should have read this before I commented on that "--require
is misnamed---what you really want is a custom filter" thing.

> * We should investigate switching the Windows CI to use `test-tool`
>   instead of prove.

OK.

> * We should determine whether it is confusing or otherwise harmful to
>   people's workflow to have the unit tests run in parallel with shell
>   tests when using prove as the default test target.

It is probably confusing especially given that the testsuite() thing
does its own parallel spawning of tests while prove does its own.
Is there a reason to choose unit-tests-test-tool Makefile target on
prove-capable platforms (other than for testing the test-tool)?

Thanks for an entertaining read.