timeout.qbk 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. [/
  2. / Copyright (c) 2015 Raffi Enficiaud
  3. /
  4. / Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. /]
  7. [section:timeout Time-out for test cases]
  8. The __UTF__ provides the decorator __decorator_timeout__ that specifies a time-out for a specific *test unit*.
  9. The argument time is always expressed in *seconds ans wall-clock* time.
  10. For test-cases, the time-out value sets the maximum allowed duration for the test. If this time is
  11. exceeded, the test case is reported as failed. On some systems, the __UTF__ is able to force the test-case
  12. to stop through a `SIGALRM` signal (see below).
  13. For test-suites, the time-out value sets the maximum allowed duration for the entire suite to complete. This duration
  14. is the accumulated time of all the test-cases contained in the sub-tree rooted on the test-suite, plus some extra
  15. execution time needed by the __UTF__. For each test-units under a test-suite with time-out, the maximum allowed duration
  16. is set as being the test-suite time out minus the accumulated execution time before the execution of the test-unit.
  17. If this test-unit is a test-case, it is equivalent to setting the decorator __decorator_timeout__ to the test-case
  18. with a time-out value expressed as before.
  19. In case the test-suite times out, the
  20. suite is flagged as `timed-out` and `failed`, and all the test units (suites and cases) that have not been executed
  21. up to the time-out point are all skipped.
  22. [bt_example decorator_11..decorator timeout..run-fail]
  23. [note The macro
  24. `BOOST_SIGACTION_BASED_SIGNAL_HANDLING` is defined
  25. if Boost.Test is able to force the test-case to stop. This feature is for instance not supported on Windows.
  26. The __UTF__ will still be able to report the test-case as failed (once the test-case finishes).]
  27. [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] ]
  28. [endsect]