From 4ebce2c3f25d98f9ba49d9fcc343ffbe760363af Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 25 Aug 2019 04:26:41 +1000 Subject: Add test priorities to force test start order --- docs/markdown/Unit-tests.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs/markdown/Unit-tests.md') diff --git a/docs/markdown/Unit-tests.md b/docs/markdown/Unit-tests.md index 3c2773205..9c2e3d50b 100644 --- a/docs/markdown/Unit-tests.md +++ b/docs/markdown/Unit-tests.md @@ -51,6 +51,19 @@ By default Meson uses as many concurrent processes as there are cores on the tes $ MESON_TESTTHREADS=5 ninja test ``` +Priorities +-- + +Tests can be assigned a priority that determines when a test is *started*. Tests with higher priority are started first, tests with lower priority started later. The default priority is 0, meson makes no guarantee on the ordering of tests with identical priority. + +```meson +test('started second', t, priority : 0) +test('started third', t, priority : -50) +test('started first', t, priority : 1000) +``` + +Note that the test priority only affects the starting order of tests and subsequent tests are affected by how long it takes previous tests to complete. It is thus possible that a higher-priority test is still running when lower-priority tests with a shorter runtime have completed. + ## Skipped tests and hard errors Sometimes a test can only determine at runtime that it can not be run. -- cgit v1.2.3