summaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-11-20 08:58:10 +0100
committerDylan Baker <dylan@pnwbakers.com>2024-12-19 09:25:20 -0800
commit8b9846d9a9d29b427860891c9b699eb4305e348b (patch)
tree16e602e2e56fc175177eab9c56a0cbf97d5cda33 /docs/markdown
parenteb35d1a05f08f6969851cea81889e3beffdb9ec2 (diff)
downloadmeson-8b9846d9a9d29b427860891c9b699eb4305e348b.tar.gz
mtest: move determine_worker_count to utils, generalize
It is useful to apply a limit to the number of processes even outside "meson test", and specifically for clang tools. In preparation for this, generalize determine_worker_count() to accept a variable MESON_NUM_PROCESSES instead of MESON_TESTTHREADS, and use it throughout instead of multiprocessing.cpu_count(). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Unit-tests.md8
-rw-r--r--docs/markdown/snippets/num-processes.md7
2 files changed, 12 insertions, 3 deletions
diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md
index 898366095..13f6093f2 100644
--- a/docs/markdown/Unit-tests.md
+++ b/docs/markdown/Unit-tests.md
@@ -83,16 +83,18 @@ possible.
By default Meson uses as many concurrent processes as there are cores
on the test machine. You can override this with the environment
-variable `MESON_TESTTHREADS` like this.
+variable `MESON_TESTTHREADS` or, *since 1.7.0*, `MESON_NUM_PROCESSES`:
```console
-$ MESON_TESTTHREADS=5 meson test
+$ MESON_NUM_PROCESSES=5 meson test
```
-Setting `MESON_TESTTHREADS` to 0 enables the default behavior (core
+Setting `MESON_NUM_PROCESSES` to 0 enables the default behavior (core
count), whereas setting an invalid value results in setting the job
count to 1.
+If both environment variables are present, `MESON_NUM_PROCESSES` prevails.
+
## Priorities
*(added in version 0.52.0)*
diff --git a/docs/markdown/snippets/num-processes.md b/docs/markdown/snippets/num-processes.md
new file mode 100644
index 000000000..e4ffdd1dc
--- /dev/null
+++ b/docs/markdown/snippets/num-processes.md
@@ -0,0 +1,7 @@
+## Control the number of child processes with an environment variable
+
+Previously, `meson test` checked the `MESON_TESTTHREADS` variable to control
+the amount of parallel jobs to run; this was useful when `meson test` is
+invoked through `ninja test` for example. With this version, a new variable
+`MESON_NUM_PROCESSES` is supported with a broader scope: in addition to
+`meson test`, it is also used by the `external_project` module.