summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-05-03 10:05:24 +0200
committerEli Schwartz <eschwartz93@gmail.com>2024-05-08 08:05:44 -0400
commitbcaab91bf61327bb7c2a0259292c2a336ad6513a (patch)
treed36800aee4f941a14d85d3b419709e9d4f29448f /docs
parent14de8ac5a9e04490a67e3ddcbd44b31915aed1b9 (diff)
downloadmeson-bcaab91bf61327bb7c2a0259292c2a336ad6513a.tar.gz
mtest: Set MESON_TEST_ITERATION to the current iteration of the test
When running our integration tests in systemd we depend on each test having a unique name. This is always the case unless --repeat is used, in which case multiple tests with the same name run concurrently which causes issues when allocating resources that use the test name as the identifier. Let's set MESON_TEST_ITERATION to the current iteration of the test so we can use $TEST_NAME-$TEST_ITERATION as our test identifiers which will avoid these issues.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Unit-tests.md3
-rw-r--r--docs/markdown/snippets/test_iteration.md5
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md
index 73e58dc68..6fda0f5f6 100644
--- a/docs/markdown/Unit-tests.md
+++ b/docs/markdown/Unit-tests.md
@@ -208,6 +208,9 @@ Sometimes you need to run the tests multiple times, which is done like this:
$ meson test --repeat=10
```
+Meson will set the `MESON_TEST_ITERATION` environment variable to the
+current iteration of the test *(added 1.5.0)*.
+
Invoking tests via a helper executable such as Valgrind can be done with the
`--wrap` argument
diff --git a/docs/markdown/snippets/test_iteration.md b/docs/markdown/snippets/test_iteration.md
new file mode 100644
index 000000000..67daf2781
--- /dev/null
+++ b/docs/markdown/snippets/test_iteration.md
@@ -0,0 +1,5 @@
+## meson test now sets the `MESON_TEST_ITERATION` environment variable
+
+`meson test` will now set the `MESON_TEST_ITERATION` environment variable to the
+current iteration of the test. This will always be `1` unless `--repeat` is used
+to run the same test multiple times.