Commit Graph

197 Commits

Author SHA1 Message Date
Brad King
18153217e2 Merge topic 'ctest_start_function_scope'
13347740 Help: add release notes, documentation for CTEST_RUN_CURRENT_SCRIPT behavior
74092d92 cmCTestScriptHandler: Add new field ShouldRunCurrentScript

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1703
2018-01-29 08:04:59 -05:00
Kyle Edwards
74092d92bf cmCTestScriptHandler: Add new field ShouldRunCurrentScript
This is to avoid scope issues with CTEST_RUN_CURRENT_SCRIPT. If
ctest_start() is called within a function scope, the value of
CTEST_RUN_CURRENT_SCRIPT that it sets doesn't make it to the global
scope. With this change, ctest_start() no longer sets
CTEST_RUN_CURRENT_SCRIPT, and instead sets a field directly in
cmCTestScriptHandler. The old behavior of CTEST_RUN_CURRENT_SCRIPT
has also been kept for projects and tests that rely on setting it.
2018-01-26 09:27:22 -05:00
Wouter Klouwen
695951bc46 CTest: introduce cmDuration
This commit introduces cmDuration as a typedef for
std::chrono::duration<double, std::ratio<1>>. It is less verbose and
provides for a point to put future common functionality for durations.

No functional change intended.
2018-01-23 10:04:38 -05:00
Brad King
2567e5df69 cmCTest: Refactor stop time calculations
Calculate the stop time up front instead of re-parsing its string for
every test.
2018-01-08 12:55:00 -05:00
Brad King
1138feb38f cmCTest: Remove unused member LastStopTimeout
This member was added by commit v2.8.2~285 (Better detection of
stop_time being passed, 2010-03-19), but its logic has no effect.
The member is only used for comparison against a value to which
it was just assigned.
2018-01-08 12:55:00 -05:00
Brad King
1f5b2a8de9 Merge topic 'fix-ctest-chrono'
ba6caafa CTest: Use integer-representable value for "infinite" timeout
548e8f6f CTest: Simplify std::chrono::duration<double> conversion to double
de0035fd cmCTestBuildAndTestHandler: Convert timeout to std::chrono::duration
687a26b7 CTest: Fix regression in build-and-test timeout forwarding
e770b1b8 CTest: Fix regression in build-and-test timeout compuatation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: dublet <github@dublet.org>
Merge-request: !1574
2017-12-12 08:02:33 -05:00
Brad King
ba6caafa42 CTest: Use integer-representable value for "infinite" timeout
Refactoring in commit 66419bc046 (CTest: convert timeouts to
std::chrono::duration, 2017-11-20) changed out "infinite" timeout to a
value not representable by a 64-bit integer.  This causes undefined
behavior when e.g. KWSys Process converts the duration to a `long` to
interact with system APIs.  Use the old `1.0e7` maximum value.
2017-12-11 10:41:48 -05:00
Brad King
f984296ba8 CTest: Remove unfinished batch test mode
This was partially implemented by commit v2.8.0~154 (Added some ctest
batch capabilities, 2009-09-10) but never finished.
2017-12-08 11:23:33 -05:00
Wouter Klouwen
66419bc046 CTest: convert timeouts to std::chrono::duration
This commit continues the refactoring of CTest to adopt std::chrono.
After the last sets of changes that introduced std::chrono::steady_clock
and std::chrono::system_clock respectively, it makes sense to have all
the timeouts be stored as std::chrono::duration.

No functional change intended.
2017-12-04 10:43:14 -05:00
Betsy McPhail
e80dc2ad7f cmCTest: Remove dead code
The option 'ctest-config' is ignored.
2017-11-07 14:15:20 -05:00
Rolf Eike Beer
69fac3c3d5 pass arguments as vector to cmCTest::RunCommand()
The only 2 callers took care to construct a properly escaped string, but not
using the documented way, and that string was passed only to be immediately
split into tokens again. Start with a vector and join it only for logging,
avoiding needless quotes during that.
2017-09-15 17:50:56 +02:00
Daniel Pfeifer
ca2233e31f IWYU: Mark cmConfigure.h with pragma: keep
Also remove `#include "cmConfigure.h"` from most source files.
2017-08-26 07:41:04 +02:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Betsy McPhail
47b3a57c9b Display subproject timing summary
Use the '--no-subproject-summary' option to disable timing summary.
2017-07-10 16:25:18 -04:00
Betsy McPhail
d08ec4d25a Add CTEST_LABELS_FOR_SUBPROJECTS as a CTest module and script variable
Use this variable to specify a list of labels that will be reported to
CDash as subprojects.
2017-07-10 16:25:18 -04:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
Automate with:

git grep -l '#include <cm_' -- Source \
  | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'

git grep -l '#include <cmsys/' -- Source \
  | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'

git grep -l '#include <cm[A-Z]' -- Source \
  | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
2017-04-11 22:35:21 +02:00
Daniel Pfeifer
bcd08aa383 cmCTest: Move macros to bottom of file
Since the class name is used in the macros, the iwyu tool gets confused
wheter it needs a forward declaration or not.
2017-03-23 23:08:56 +01:00
Daniel Pfeifer
ee72803e9f fix some include-what-you-use diagnostics 2017-02-17 22:12:21 +01:00
Daniel Pfeifer
2988abd939 clang-tidy: apply modernize-use-bool-literals fixes 2016-12-12 14:04:14 -05:00
Daniel Pfeifer
7c9db8f813 clang-tidy: apply performance-unnecessary-value-param fixes 2016-12-12 14:04:12 -05:00
Daniel Pfeifer
7b4244aceb iwyu: Fix more findings 2016-11-28 14:06:40 -05:00
Dāvis Mosāns
40bd42dfbc Add Encoding option for RunChild, RunMakeCommand and RunProcess 2016-11-15 01:00:46 +02:00
Zack Galbreath
d3633731ab Do not query CDash for version
This check was not functioning properly for the following reasons:

* The "DropSite" and "DropLocation" CTest Configurations do not
get set until ctest_submit() is called.  So if ctest_submit()
was not called before ctest_test() we would end up with uncompressed
output, even if the CDash server was new enough to support this feature.

* CDash's API is now versioned. The current location to query is
now /api/v1/getversion.php, not /api/getversion.php.

As a result of these issues, CTest would not compress test/memcheck
output when it should.  Rather than fix this check, we now assume that
CTest is communicating with a new enough version of CDash.  This behavior
can be controlled through the use of the --no-compress-output command-line
argument.
2016-11-08 15:58:50 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Daniel Pfeifer
efed6468ed fix a load of include-what-you-use violations 2016-09-03 08:04:56 -04:00
Daniel Pfeifer
bd3d0eafbb cmCTest: don't redefine cout and cerr
The definitions have been introduced to ensure that cout and cerr are
not used in certain files.  However, this limitation does not apply to
all source files that require cmCTest.h to be included.  Furthermore,
the definitions cause side effects depending on the include order.  In
total, the definitions do more harm than good.  Remove them.
2016-09-03 08:04:22 -04:00
Daniel Pfeifer
3838a0d5fb make sure to include cmConfigure.h before cmStandardIncludes.h 2016-09-03 08:04:22 -04:00
Jean-Christophe Fillion-Robin
0076fb100b cmCTest: Update doxygen to be consistent 2016-07-05 11:19:01 -04:00
Jean-Christophe Fillion-Robin
30c5f94c5b cmCTest: Rename "ProcessTests()" to "ProcessSteps()" and improve doxygen 2016-07-05 11:19:00 -04:00
Jean-Christophe Fillion-Robin
6d8b9aa65a cmCTest: Improve readability adding "HandleTest(Action|Model)Argument()" 2016-07-05 11:19:00 -04:00
Jean-Christophe Fillion-Robin
280d0a6947 cmCTest: Improve readability adding "RunCMakeAndTest()" and "ExecuteTests()" 2016-07-05 11:19:00 -04:00
Daniel Pfeifer
1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04:00
Daniel Pfeifer
618fb23fc9 Pass arguments that are not modified as const&.
Use clang-tidy's performance-unnecessary-value-param checker to find
value parameter declarations of expensive to copy types that are not
modified inside the function.  Ignore findings in kwsys.
After applying the fix-its, manually change `const T&` to `T const&`.
2016-05-26 21:58:51 +02:00
Kitware Robot
d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Brad King
180538c706 Source: Stabilize include order
Each source file has a logical first include file.  Include it in an
isolated block so that tools that sort includes do not move them.
2016-04-29 13:58:31 -04:00
Daniel Pfeifer
140b186480 CTest: hide progress ticks in verbose output
The progress ticks and information about the length of the output are
useful when the actual output is not visible.  When the output is
printed, the progress ticks

* add no useful information,
* do not look pretty, and
* make the output hard to parse for tools.
2015-07-06 14:04: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
Daniel Pfeifer
de2ef3053c cmCTest: Drop unused method overloads
The StartXML, EndXML, and AddSiteProperties overloads that take a stream
directly are no longer called anywhere.  All clients hvae been ported to
cmXMLWriter.  Drop the old overloads.
2015-05-26 11:09:22 -04:00
Daniel Pfeifer
a53bd63e0c cmCTest: Port GenerateNotesFile to cmXMLWriter 2015-05-26 11:09:21 -04:00
Daniel Pfeifer
18825bafd9 cmCTest: Port to cmXMLWriter
Re-implement StartXML, EndXML, and AddSiteProperties using cmXMLWriter.
Leave the old overloads behind for use by CTest/* until they are ported.
2015-05-26 11:09:20 -04: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
Zack Galbreath
12db113944 CTest: Add cmCTestOptionalLog macro
cmCTestOptionalLog takes a boolean argument that indicates
whether or not the message should be suppressed.  Note that
error messages will still be printed, even if suppression is
requested.  This macro will allow us to provide more
fine-grained control over what messages CTest prints to the
console.
2015-02-23 10:01:58 -05:00
Stephen Kelly
931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Bill Hoffman
7762fffa23 Change output to be a reference and not a pointer.
This avoids having to check the pointer value at each use which
was not being done.
2014-08-04 15:16:40 -04:00
Stephen Kelly
6c19024570 Remove extra semicolons from C++ code.
Clang based tools running over the code complain about these,
but clang has a fixit for removing them.
2014-04-03 21:53:14 +02:00
Ben Boeckel
270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Ben Boeckel
83a5e453f8 stringapi: Use strings for test names 2014-03-08 13:05:30 -05:00
Ben Boeckel
3742bb0d32 stringapi: Use strings for variable names
Variable names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Clinton Stimpson
5730710c86 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
2014-01-07 09:27:44 -05:00
Brad King
d1526f825e Refactor internal resource location APIs and initialization
Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources.
Teach it to compute the locations of cmake, ctest, cpack, ccmake, and
cmake-gui executables, and the location of CMAKE_ROOT.  Provide this
information from static cmSystemTools::Get<resource>() methods.
Refactor code that needs these locations to use the new APIs.

Teach FindCMakeResources to use the OS X system API to lookup the
executable location.  When running from the CMake build tree itself,
leave a file in the tree that FindCMakeResources can use to read the
location of the source tree.  This avoids the need to compile the source
tree location into a binary that may be installed and used without the
source tree.

Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build
tree next to "cmake" and the other tools, as is already done in the
install tree for the application bundle.  This ensures a consistent set
of executables are available in one directory.
2013-11-12 08:23:35 -05:00