diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/markdown/Unit-tests.md | 6 | ||||
| -rw-r--r-- | docs/markdown/snippets/sanitizers_test.md | 5 | ||||
| -rw-r--r-- | docs/yaml/functions/test.yaml | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md index 030eb19c4..7ad95d264 100644 --- a/docs/markdown/Unit-tests.md +++ b/docs/markdown/Unit-tests.md @@ -38,6 +38,12 @@ set to a random value between 1..255. This can help find memory leaks on configurations using glibc, including with non-GCC compilers. This feature can be disabled as discussed in [[test]]. +### ASAN_OPTIONS and UBSAN_OPTIONS + +By default, the environment variables `ASAN_OPTIONS` and `UBSAN_OPTIONS` are +set to enable aborting on detected violations and to give a backtrace. This +feature can be disabled as discussed in [[test]]. + ## Coverage If you enable coverage measurements by giving Meson the command line diff --git a/docs/markdown/snippets/sanitizers_test.md b/docs/markdown/snippets/sanitizers_test.md new file mode 100644 index 000000000..24929114b --- /dev/null +++ b/docs/markdown/snippets/sanitizers_test.md @@ -0,0 +1,5 @@ +## Tests now abort on errors by default under sanitizers + +Sanitizers like AddressSanitizer and UndefinedBehaviorSanitizer do not abort +by default on detected violations. Meson now exports `ASAN_OPTIONS` and `UBSAN_OPTIONS` +when unset in the environment to provide sensible abort-by-default behavior. diff --git a/docs/yaml/functions/test.yaml b/docs/yaml/functions/test.yaml index 4e791671c..622b7c3b0 100644 --- a/docs/yaml/functions/test.yaml +++ b/docs/yaml/functions/test.yaml @@ -33,6 +33,10 @@ description: | test(..., env: nomalloc, ...) ``` + By default, the environment variables `ASAN_OPTIONS` and `UBSAN_OPTIONS` are + set to enable aborting on detected violations and to give a backtrace. To suppress + this, `ASAN_OPTIONS` and `UBSAN_OPTIONS` can be set in the environment. + In addition to running individual executables as test cases, `test()` can also be used to invoke an external test harness. In this case, it is best to use `verbose: true` *(since 0.62.0)* and, if supported |
