Merge pull request #11584 from Mic92/devdocs

This commit is contained in:
Valentin Gagarin 2024-09-25 13:44:49 +02:00 committed by GitHub
commit 6c37d81514
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -162,7 +162,7 @@ ninja: no work to do.
Individual tests can be run with `meson`: Individual tests can be run with `meson`:
```shell-session ```shell-session
$ meson test ${testName} $ meson test --verbose ${testName}
ninja: Entering directory `/home/jcericson/src/nix/master/build' ninja: Entering directory `/home/jcericson/src/nix/master/build'
ninja: no work to do. ninja: no work to do.
1/1 nix-functional-tests:main / ${testName} OK 0.41s 1/1 nix-functional-tests:main / ${testName} OK 0.41s
@ -177,7 +177,11 @@ Timeout: 0
Full log written to /home/jcericson/src/nix/master/build/meson-logs/testlog.txt Full log written to /home/jcericson/src/nix/master/build/meson-logs/testlog.txt
``` ```
or without `meson`, showing the output: The `--verbose` flag will make Meson also show the console output of each test for easier debugging.
The test script will then be traced with `set -x` and the output displayed as it happens,
regardless of whether the test succeeds or fails.
Tests can be also run directly without `meson`:
```shell-session ```shell-session
$ TEST_NAME=${testName} NIX_REMOTE='' PS4='+(${BASH_SOURCE[0]-$0}:$LINENO) tests/functional/${testName}.sh $ TEST_NAME=${testName} NIX_REMOTE='' PS4='+(${BASH_SOURCE[0]-$0}:$LINENO) tests/functional/${testName}.sh
@ -188,8 +192,6 @@ output from bar
... ...
``` ```
The test script will then be traced with `set -x` and the output displayed as it happens, regardless of whether the test succeeds or fails.
### Debugging failing functional tests ### Debugging failing functional tests
When a functional test fails, it usually does so somewhere in the middle of the script. When a functional test fails, it usually does so somewhere in the middle of the script.