add TEZT_JOB_COUNT to control --job-count
What
This MR makes it possible to specify the value of --job-count
using environment variable TEZT_JOB_COUNT
instead.
Why
How
By reading TEZT_JOB_COUNT
and passing it to Clap as the default value of --job-count
. This means that:
-
--help
will show the value ofTEZT_JOB_COUNT
as the default value (ifTEZT_JOB_COUNT
is a positive integer) -
--job-count
has priority overTEZT_JOB_COUNT
Manually testing the MR
TEZT_JOB_COUNT=8 dune exec test/unix/main.exe -- -v
Observe that multiple tests are started before any ends.
TEZT_JOB_COUNT=8 dune exec test/unix/main.exe -- -v --job-count 1
Observe that --job-count
has priority.
TEZT_JOB_COUNT=plop dune exec test/unix/main.exe -- --help | less -R
Observe that plop
was ignored. You can also replace plop
with a negative integer or 0
and see that those values are also ignored.
I didn't add a cram test because it would be a pain, I think.
Checklist
-
Update CHANGES.md
. No need to document changes to documentation and tests. -
Make sure all new values, types etc. are documented in .mli
files and that the generated documentation looks ok. -
Add tests in test/
, if relevant.