File: timeout.qbk

package info (click to toggle)
boost1.83 1.83.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 545,632 kB
  • sloc: cpp: 3,857,086; xml: 125,552; ansic: 34,414; python: 25,887; asm: 5,276; sh: 4,799; ada: 1,681; makefile: 1,629; perl: 1,212; pascal: 1,139; sql: 810; yacc: 478; ruby: 102; lisp: 24; csh: 6
file content (38 lines) | stat: -rw-r--r-- 1,978 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[/
 / Copyright (c) 2015 Raffi Enficiaud
 /
 / Distributed under the Boost Software License, Version 1.0. (See accompanying
 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 /]


[section:timeout Time-out for test cases]

The __UTF__ provides the decorator __decorator_timeout__ that specifies a time-out for a specific *test unit*.
The argument time is always expressed in *seconds ans wall-clock* time.

For test-cases, the time-out value sets the maximum allowed duration for the test. If this time is
exceeded, the test case is reported as failed. On some systems, the __UTF__ is able to force the test-case
to stop through a `SIGALRM` signal (see below).

For test-suites, the time-out value sets the maximum allowed duration for the entire suite to complete. This duration
is the accumulated time of all the test-cases contained in the sub-tree rooted on the test-suite, plus some extra
execution time needed by the __UTF__. For each test-units under a test-suite with time-out, the maximum allowed duration
is set as being the test-suite time out minus the accumulated execution time before the execution of the test-unit.
If this test-unit is a test-case, it is equivalent to setting the decorator __decorator_timeout__ to the test-case
with a time-out value expressed as before.

In case the test-suite times out, the
suite is flagged as `timed-out` and `failed`, and all the test units (suites and cases) that have not been executed
up to the time-out point are all skipped.

[bt_example decorator_11..decorator timeout..run-fail]

[note The macro
  `BOOST_SIGACTION_BASED_SIGNAL_HANDLING` is defined
  if Boost.Test is able to force the test-case to stop. This feature is for instance not supported on Windows.
  The __UTF__ will still be able to report the test-case as failed (once the test-case finishes).]

[note The support of test suite level time-out has been added in [link ref_CHANGE_LOG_3_10 Boost 1.70 / __UTF__ v3.10] ]

[endsect]