summaryrefslogtreecommitdiff
path: root/docs/markdown/Unit-tests.md
AgeCommit message (Collapse)Author
2025-04-07Fix documentation typosEmil Berg
2025-04-06docs: say '--wrapper', not '--wrap' for testsSam James
We document --wrapper and --wrap works only by expanding it automatically to --wrapper as it is unambiguous.
2025-03-24Fix doc for `meson test --print-errorlogs` [skip ci]Khairul Azhar Kasmiran
2025-02-27mtest: add option to slice testsPatrick Steinhardt
Executing tests can take a very long time. As an example, the Git test suite on Windows takes around 4 hours to execute. The Git project has been working around the issue by splitting up CI jobs into multiple slices: one job creates the build artifacts, and then we spawn N test jobs with those artifacts, where each test job executes 1/Nth of the tests. This can be scripted rather easily by using `meson test --list`, selecting every Nth line, but there may be other projects that have a similar need. Wire up a new option "--slice i/n" to `meson test` that does implements this logic. Signed-off-by: Patrick Steinhardt <ps@pks.im>
2024-12-19mtest: move determine_worker_count to utils, generalizePaolo Bonzini
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>
2024-08-30Extend MESON_TESTTHREADS usageMarek Pikuła
Previously, setting `MESON_TESTTHREADS` to a number lower than 1 resulted in unexpected behavior. This commit introduces test for negative value (with fallback to 1), and fallback to core count in case it is set to 0. It improves experience in job-matrix type of CI workflows, where some jobs within the matrix require single job execution, whereas others can default to taking core count as the job count. Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-06-17Add meson test --max-linesDaan De Meyer
Let's allow users to configure how many lines are shown at most when a test fails.
2024-05-08mtest: Set MESON_TEST_ITERATION to the current iteration of the testDaan De Meyer
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.
2024-04-23Add meson test --interactiveDaan De Meyer
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.
2024-02-23mtest: set MSAN_OPTIONS to abort by defaultSam James
Followup to 7b7d2e060b447de9c2642848847370a58711ac1c which handles ASAN and UBSAN. It turns out that MSAN needs the same treatment. I've checked other sanitizers like HWASAN and TSAN - it looks like they may both need it too, but Meson doesn't currently suppose those anyway (see https://github.com/mesonbuild/meson/pull/12648). Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2023-10-19mtest: set ASAN_OPTIONS and UBSAN_OPTIONS to abort by defaultSam James
Do as we do for MALLOC_PERTURB and set a sensible value for both ASAN_OPTIONS and UBSAN_OPTIONS to abort on failure and give more helpful output at the same time. We do not set these options if the user has exported a value themselves to allow override. In the last week alone, I've observed two cases where people were expecting sanitizers to abort on failure and were surprised when it didn't: 1) https://github.com/git/git/commit/252d693797912ddb2684733160170f0408b73274 2) https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/c47df433f7bc9936fc59b323ca5e53ea4a04f40e Correct this - which is in-line with meson's DWIM/DTRT philosophy. Signed-off-by: Sam James <sam@gentoo.org>
2023-09-18Update link to lcovEberhard Beilharz
lcov moved from sourceforge to github, so this change updates the link.
2023-05-25mtest: wildcard selectionCharles Brunet
Allow the use of wildcards (e.g. *) to match test names in `meson test`. Raise an error is given test name does not match any test. Optimize the search by looping through the list of tests only once.
2023-04-11Change "can not" to "cannot" throughout projectHiPhish
The word "cannot" expresses inability to do something whereas "can not" expresses the ability to refrain from doing something.
2022-10-23Fix typos in docsElliott Sales de Andrade
2022-06-21docs: grammar and formatting nitsEli Schwartz
2022-06-21docs: remove incorrect information about nonexisting kwargEli Schwartz
2022-06-21Update Unit-tests.md (#10515)CLanguagePurist
2021-10-03docs: Fix broken linksDaniel Mensinger
2021-07-23Add support for gcovr --sonarqube reportWeston Schmidt
Sonarcloud.io only can read the sonarqube based report that gcovr can produce. This change enables support for this output in meson and ninja. Signed-off-by: Weston Schmidt <Weston_Schmidt@alumni.purdue.edu>
2021-01-31Capitalize "Meson" consistently as it is a proper name. [skip ci]Jussi Pakkanen
2021-01-30Rewrap long text lines in docs. [skip ci]Jussi Pakkanen
2020-06-30Replaced `ninja` with `meson` [skip ci]TheQwertiest
2020-06-18docs: replaced `ninja` with appropriate `meson` commands [skip ci]TheQwertiest
2020-06-02docs/unit-tests: Show a test can have multiple suites [skip ci]Ebrahim Byagowi
2020-05-04docs/unit-tests: Add information about output filesDylan Baker
2020-05-04docs: Reformat unit-tests to be ~80 characters per lineDylan Baker
2020-03-09Document the requirement to run tests before coverage [skip ci]Vedran Miletić
Co-authored-by: Vedran Miletić <vedran@miletic.net>
2020-02-27doc: fix link warningsMathieu Duponchelle
2019-12-06mtest: document default MALLOC_PERTURB_=1..255 behavior [skip ci]Michael Hirsch, Ph.D
This default behavior can have surprising and time-consuming outcomes. I was wondering why certain tests using several external, fixed libraries would fail only with Meson and not with CMake or manual runs. It turned out mtest.py enables MALLOC_PERTURB_ by default, which is surprising--a topic for another Issue/PR. At least, this surprising default is documented with workarounds.
2019-11-06Fix typos found by codespellWolfgang Stöggl
- Typos were found by codespell v1.16.0
2019-10-08doc: tell that unit-tests "priority" is introduced in 0.52 [skip ci]Gabriel Ganne
2019-10-04mtest: add gdb_path optionGerion Entrup
When using the '--gdb' argument of meson test the executed binary can now be specified with '--gdb-path'. Closing: #4373
2019-08-24Add test priorities to force test start orderPeter Hutterer
2019-07-30DOC: meson test multiple --suite specifications [skip ci]Michael Hirsch, Ph.D
docs:wrap < 80 col
2019-04-24doc: Update coverage related documentationRichard Kjerstadius
2019-03-02mtest: implement TAP parsingPaolo Bonzini
This provides an initial support for parsing TAP output. It detects failures and skipped tests without relying on exit code, as well as early termination of the test due to an error or a crash. For now, subtests are not recorded in the TestRun object. However, because the TAP output goes on stdout, it is printed by --print-errorlogs when a test does not behave as expected. Handling subtests as TestRuns, and serializing them to JSON, can be added later. The parser was written specifically for Meson, and comes with its own test suite. Fixes #2923.
2019-03-02mtest: add support for hard errorsPaolo Bonzini
Hard errors also come from the GNU Automake test protocol. They happen when e.g., the set-up of a test case scenario fails, or when some other unexpected or highly undesirable condition is encountered. TAP will use them for parse errors too. Add them to the exitcode protocol first.
2018-06-29add documentation of meson test --print-errorlogs (#3809) [skip ci]Alberto Sartori
2018-04-14improve suite of meson test (#3369)Alberto Sartori
2018-02-27Allow gcovr >= 3.1 to be used to generate html coverage reportJoel Klinghed
Modern gcovr includes html generation support so if lcov and genhtml are not available fallback to gcovr. Kept lcov and genhtml as default so to not surprise existing users of coverage-html with the different output of gcovr. gcovr added html support in 3.0 but as there already is a test for 3.1 because of the changes to -r/--rootdir I opted to only allow html generation for >= 3.1 to keep things simple.
2017-10-31docs: remove references to `mesontest`Eric Engestrom
`mesontest` is deprecated, and shouldn't be suggested to users anymore.
2017-09-22Replaced references to 'mesontest'Johan Bjäreholt
'mesontest' is deprecated and is now 'meson test' Replaced all references to 'mesontest' with 'meson test' and added a note of the change in the bottom of the page
2017-07-22Fix typo in Unit-tests.mdLuca Mattiello
2017-05-21Update linkcagatay-y
Gcovr homepage is moved. Updated the link to the new URL.
2017-05-04Use American English: behaviour -> behaviorPeter Hutterer
2017-05-03doc: Use https links wherever possible.Elliott Sales de Andrade
2017-05-03doc: Capitalize things more consistently.Elliott Sales de Andrade
Upper or lower case depending on the official spelling, or the more consistent usage.
2017-05-03docs: add a short description for all top pages in the ManualPeter Hutterer
2017-04-26docs: Import the website and wiki and build with hotdocThibault Saunier
This allows us to more easily have the documentation in sync with the source code as people will have to document new features etc right at the time where they implement it.