summaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-19 16:01:48 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-23 21:36:22 +0200
commit344a97e08a695af40ec77e439582ffdc06154f21 (patch)
tree54a4e7e9936052a9ae811a90d55acf143f8b2db9 /docs/markdown
parent9e3b3db7054c7dedecd14db3e6061ff7e2227faf (diff)
downloadmeson-344a97e08a695af40ec77e439582ffdc06154f21.tar.gz
Add meson test --interactive
This is very similar to --gdb, except it doesn't spawn GDB, but connects stdin/stdout/stderr directly to the test itself. This allows interacting with integration tests that spawn a shell in a container or virtual machine when the test fails. In systemd we're migrating our integration tests to run using the meson test runner. We want to allow interactive debugging of failed tests directly in the virtual machine or container that is spawned to run the test. To make this possible, we need meson test to connect stdin/stdout/stderr of the test directly to the user's terminal, just like is done with the --gdb option.
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Unit-tests.md10
-rw-r--r--docs/markdown/snippets/test_interactive.md6
2 files changed, 16 insertions, 0 deletions
diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md
index dc509a818..73e58dc68 100644
--- a/docs/markdown/Unit-tests.md
+++ b/docs/markdown/Unit-tests.md
@@ -256,6 +256,16 @@ $ meson test --gdb --gdb-path /path/to/gdb testname
$ meson test --print-errorlogs
```
+Running tests interactively can be done with the `--interactive` option.
+`meson test --interactive` invokes tests with stdout, stdin and stderr
+connected directly to the calling terminal. This can be useful if your test is
+an integration test running in a container or virtual machine where a debug
+shell is spawned if it fails *(added 1.5.0)*:
+
+```console
+$ meson test --interactive testname
+```
+
Meson will report the output produced by the failing tests along with
other useful information as the environmental variables. This is
useful, for example, when you run the tests on Travis-CI, Jenkins and
diff --git a/docs/markdown/snippets/test_interactive.md b/docs/markdown/snippets/test_interactive.md
new file mode 100644
index 000000000..907147fd9
--- /dev/null
+++ b/docs/markdown/snippets/test_interactive.md
@@ -0,0 +1,6 @@
+## The Meson test program supports a new "--interactive" argument
+
+`meson test --interactive` invokes tests with stdout, stdin and stderr
+connected directly to the calling terminal. This can be useful when running
+integration tests that run in containers or virtual machines which can spawn a
+debug shell if a test fails.