1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Commit Graph

36 Commits

Author SHA1 Message Date
Zack Galbreath
25bf514447 ctest: Add support for writing test results in JUnit XML format
Addresses #18654
2021-04-26 08:55:22 -04:00
Brad King
82e40607a4 ctest: Display test "WAITING" messages only in extra-verbose mode
These messages are incidental scheduling output.  Avoid cluttering
the normal verbose output showing tests starting and finishing.
2021-04-06 14:48:14 -04:00
Asit Dhal
dbcf86d24d Ctest: Support build tree on command line
Fixes: #21268
2020-12-17 05:01:03 +01:00
Brad King
f9fbc78cd6 Merge topic 'ctest_stop_on_failure_16628'
e89aeba5c4 ctest: add option --stop-on-failure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4630
2020-04-22 08:38:33 -04:00
Johnny Jazeix
e89aeba5c4 ctest: add option --stop-on-failure
To stop the tests once one has failed

Fixes: #16628
2020-04-20 23:05:15 +02:00
Brad King
e03d3c08f0 CTest: Fix '-T MemCheck' command-line support for sanitizers
In commit 49948f7221 (ctest_memcheck: Add support for ThreadSanitizer,
2014-07-07, v3.1.0-rc1~322^2~1) and commit 1e005eadbc (CTest: Fix
MemoryCheckType from 'ctest -T MemCheck', 2014-07-15, v3.1.0-rc1~298^2),
the `CMakeCommand` internal setting was left set only when using `ctest
-S` scripts.  Instead simply use CTest's corresponding CMake directly
without passing it through an internal setting.

Fixes: #20584
2020-04-17 08:36:01 -04:00
Stefan Dinkelacker
a39d4139d0 Add --no-tests=<[error|ignore]> option to CTest
If no tests were found, the default behavior of CTest is to always log an
error message but to return an error code in script mode only. This option
unifies the behavior of CTest by either returning an error code if no tests
were found or by ignoring it.

Signed-off-by: Stefan Dinkelacker <s.dinkelacker@dkfz-heidelberg.de>
2020-01-31 18:17:13 +01:00
Julien Jomier
e6f758be6d ctest: Populate CTEST_CONFIGURATION_TYPE from the -C command line when set 2019-12-09 13:10:59 -05:00
Brad King
32c165d263 CTest: Consolidate '--repeat-* n' options as --repeat *:n
Combine `--repeat-until-fail`, `--repeat-until-pass`, and
`--repeat-after-timeout` to create a single `--repeat <mode>:<n>`
option.  Retain `--repeat-until-fail` too because that has been
available in previous releases.
2019-11-15 10:08:33 -05:00
Brad King
016601e5e6 Merge branch 'backport-ctest-resource-groups' 2019-11-05 12:59:16 -05:00
Brad King
af9ed543b0 CTest: Rename PROCESSES test property to RESOURCE_GROUPS
The `PROCESSES` test property name added for CMake 3.16 is too close to
the existing `PROCESSORS` test property.  Furthermore, the property in
principle specifies groups of resources organized in a way that is
meaningful to a particular test.  The groups may often correspond to
processes but they could have other meanings.  Since the property name
`PROCESSES` has not been in a final 3.16 release yet, simply rename it
to `RESOURCE_GROUPS`.

Fixes: #19914
2019-11-05 12:08:01 -05:00
Brad King
39ac8b4eb5 ctest: Add --repeat-after-timeout option
Add an option to re-run tests if they timeout.  This will help tolerate
sporadic timeouts on busy machines.
2019-10-29 15:14:36 -04:00
Brad King
80c2c9d14c ctest: Add --repeat-until-pass option
Add an option to re-run tests if they fail.  This will help tolerate
sporadic failures.

Issue: #17010
Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
Co-Author: Chuck Atkins <chuck.atkins@kitware.com>
2019-10-29 15:10:12 -04:00
Kyle Edwards
d1f100a415 CTest: Add Json output for PROCESSES property 2019-10-02 09:33:54 -04:00
Brad King
a6b01b7d45 Merge topic 'ctest-json-REQUIRED_FILES'
5778880d20 CTest: Fix --show-only=json-v1 output with REQUIRED_FILES property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3719
2019-08-23 10:07:32 -04:00
Brad King
5778880d20 CTest: Fix --show-only=json-v1 output with REQUIRED_FILES property
Fixes: #19629
2019-08-22 15:07:43 -04:00
Gabor Bencze
d7955d4e5d Tests: Create test for SKIP_REGULAR_EXPRESSION test property 2019-07-18 11:52:10 -04:00
Stephen Manz
adcbdb143c CTest: Clean up stdout and logfile output for Pass/Fail regex
For pass regex, display only the element that was found, rather
than all elements
Rename loop variable for fail regex, from pass to fail
For consistency, add space in output for pass
Add tests that find and don't find PASS_REGULAR_EXPRESSION, and a test
that finds FAIL_REGULAR_EXPRESSION, whose LastTest.log files are checked
using *-check.cmake.
2019-07-09 09:01:04 -07:00
Brad King
cae9d2a61a CTest: Teach --show-only= to reject unknown values 2019-01-17 12:01:07 -05:00
Brad King
7370b02c36 CTest: Teach --show-only=json-v1 to filter out not-available tests
Avoid exposing the internal special value that we use to track tests not
available in the tested configuration.  This also prevents clients from
having to do the filtering themselves.
2019-01-17 12:01:07 -05:00
Brad King
62fec84ad7 Tests: Fix RunCMake.CTestCommandLine case when no python is found
Do not try to run the python checks if the python executable is
not available.
2019-01-17 12:01:07 -05:00
Brad King
75a7a23746 Tests: Rename RunCMake.CTestCommandLine show-only test cases
The current name was chosen from an earlier design iteration of the
command-line option name.  Rename the case to match the final name.
2019-01-17 10:57:51 -05:00
Brad King
67209a9291 Tests: Add cases for ctest --show-only=json-v1 2019-01-10 07:37:35 -05:00
Brad King
86e8315482 CTest: Restore inheritance of stdin by test processes
Since commit v3.11.0-rc1~117^2 (CTest: Re-implement test process
handling using libuv, 2017-12-10) we do not give the child test
processes any stdin.  Prior to that change we let the child test
processes inherit stdin from ctest itself.  Tests that run serially
might be able to use the real stdin meaningfully, so restore that
behavior and add a test case.

Fixes: #18591
2018-11-15 08:08:56 -05:00
Brad King
292ec157b6 CTest: Fix --test-load regression
The `ctest --test-load` option is implemented in `StartNextTests` by not
starting any tests when the load is too high and instead sleeping and
then returning.  Prior to commit v3.11.0-rc1~117^2 (CTest: Re-implement
test process handling using libuv, 2017-12-10) our outer loop in
`RunTests` would immediately call `StartNextTests` again.  However, now
the `uv_run` loop may simply terminate if there are no tests running
because no events are left pending.

Fix this by converting the sleep in `StartNextTests` into a libuv timer
that it starts instead.  This avoids leaving `uv_run` with no pending
events.  In the case that there are other running tests this also allows
CTest to detect when they finish even if it during the wait period where
we previously slept.

This regression was not caught by the test suite because it only
verified that we do not start new tests when the load was too high and
not that we proceed to start tests when the load drops.  Revise the test
suite to cover both.

Fixes: #18338
2018-09-10 07:32:16 -04:00
Brad King
6be53c6695 CTest: Add options to control test process affinity to CPUs
In commit v2.8.0~170 (ENH: Added ctest test options PROCESSORS and
RUN_SERIAL, 2009-09-07) CTest learned to track the number of processors
allocated to running tests in order to balance it against the desired
level of parallelism.  Extend this idea by introducing a new
`PROCESSOR_AFFINITY` test property to ask that CTest run a test
with the CPU affinity mask set.  This will allow a set of tests
that are running concurrently to use disjoint CPU resources.
2018-03-05 09:21:32 -05:00
Betsy McPhail
7904b659ea Tests: Remove incorrect use of 'test-timeout' option 2017-11-10 07:52:05 -05:00
Zack Galbreath
f725b20be3 Update tests that expect uncompressed output
Pass --no-compressed-output to ctest for tests that expect uncompressed output.
2016-11-08 15:58:29 -05:00
Brad King
e61973e1ab CTest: Fix regression in handling of a RUN_SERIAL test that fails
Refactoring in commit v3.4.0-rc1~390^2~1 (cmCTestMultiProcessHandler:
Refactor RUN_SERIAL implementation, 2015-06-01) forgot to update a code
path for cleaning up after a failed RUN_SERIAL test.  This causes an
infinite loop after a RUN_SERIAL test fails.  Fix it and add a test.
2015-10-23 09:55:25 -04:00
Roman Wüger
fd47df4503 CTest: Add options to limit output of passed and failed tests
Add ctest command-line options:

  --test-output-size-passed <n>
  --test-output-size-failed <n>

to set the amount of test output to store in Test.xml as a command-line
dashboard client.
2015-09-18 11:32:06 -04:00
Betsy McPhail
42747fcc73 CTest: Show the number of tests for each label in the summary 2015-07-06 10:06:35 -04:00
Betsy McPhail
f62d301b92 ctest: Optionally avoid starting tests that may exceed a given CPU load
Add a TestLoad setting to CTest that can be set via a new --test-load
command-line option, CTEST_TEST_LOAD variable, or TEST_LOAD option to
the ctest_test command.  Teach cmCTestMultiProcessHandler to measure
the CPU load and avoid starting tests that may take more than the
spare load currently available.  The expression

 <current_load> + <test_processors> <= <max-load>

must be true to start a new test.

Co-Author: Zack Galbreath <zack.galbreath@kitware.com>
2015-06-30 10:21:37 -04:00
Brad King
721b7e3e56 CTest: Capture test stdout/stderr through one pipe (#15600)
Use the KWSys Process "MergeOutput" option to give each test child
process the same pipe for both stdout and stderr.  This allows natural
merging of stdout and stderr together instead of merging on arbitrary
buffered read boundaries as before.
2015-06-03 08:47:49 -04:00
Brad King
3837c48334 Tests: Add case for 'ctest' run with bad CTestTestfile 2015-05-14 20:36:27 +02:00
Stephen Kelly
fcf9cf6cd8 Tests: Make a CTest test deterministic.
The test expect sub-test not to run in parallel.
2015-04-21 00:31:02 +02:00
Bill Hoffman
fde70a1b26 ctest: Add a new --repeat-until-fail option
This option tells ctest to run each test N times until the test fails or
the N times have run. This is useful for finding random failing tests.
2015-03-23 09:08:22 -04:00