Commit Graph

55 Commits

Author SHA1 Message Date
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* 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.

Issue: #26123
2025-01-23 13:09:50 -05:00
Daniel Pfeifer
9c23f8ed26 cmCTestUpdateCommand: Remove handler usage 2024-11-13 10:54:57 +01:00
Daniel Pfeifer
255b1af5af cmCTestUpdateHandler: Move class into cmCTestUpdateCommand.cxx
Place declaration and definitions into places where following
refactoring will cause minimal deltas.
2024-11-13 10:39:44 +01:00
Daniel Pfeifer
8768a0c6e1 cmCTest*Command: Port away from cmCommand
Copy the necessary parts, but remove cloning and make all commands
immutable.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
c98ed10d0f cmCTest*Command: Declare member functions const 2024-11-05 10:20:12 +01:00
Daniel Pfeifer
0e995d4897 cmCTest*Command: Direct use of cmExecutionStatus
Make sure that getting Makefile and setting Error is both done
through a `status` argument rather than through `cmCommand`.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
26a697f7c1 cmCTest*Command: Access Makefile through an alias
At the top of each function that requires access to Makefile,
declare an alias `mf = this->Makefile`.  Then replace all occurrences
of `this->Makefile->` with `mf.`.  The intention is to make following
changes easier to review.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
ff2ec0387a cmCTest*Command: Generalize argument parsing and checking
Move the instantiation of unparsed arguments as well as the `parser.Parse` call
behind an abstraction.  Merge checks on `captureCMakeError`.
2024-11-05 10:20:12 +01:00
Daniel Pfeifer
4ffc408ed9 cmCTest*Command: Loosen coupling with cmArgumentParser
Instead of inheriting from `cmArgumentParser<void>` and binding arguments by
overriding `BindArguments`, define a struct for the arguments and instantiate
a static const parser in the `InitialPass` function of each command.  Pass the
argument struct down to all functions that need to access it.
2024-11-05 10:08:23 +01:00
Daniel Pfeifer
1a2d453b94 cmCTest*Command: Access arguments through an alias
At the top of each function that requires access to arguments,
declare an alias `args = *this`.  Then access all arguments with
`args.` rather than `this->`.  The intention is to make following
changes easier to review.
2024-11-05 10:08:23 +01:00
Daniel Pfeifer
c1de0976f8 cmCTest*Command: Bring all classes to a uniform layout
Make sure that all classes have a public inherited constructor, protected
data members for the arguments, followed by other private virtual functions.
The intention is to make following changes to have a smaller diff.
2024-11-05 10:08:23 +01:00
Daniel Pfeifer
d07a35a336 cmCTest: Remove handler instances 2024-10-29 12:49:22 +01:00
Brad King
719376b0a6 Merge topic 'no-stringly-typed-variables'
5497eba1a0 CTestUpdate: Prefer concrete variables over map entries
8cac63814c CTestSubmit: Prefer concrete variables over map entries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9935
2024-10-25 08:27:43 -04:00
Daniel Pfeifer
5497eba1a0 CTestUpdate: Prefer concrete variables over map entries 2024-10-23 23:52:47 +02:00
Daniel Pfeifer
f5a314cc35 cmCTestGenericHandler: Add cmCTest* argument to Initialize function 2024-10-23 23:42:14 +02:00
Marc Chevrier
8f52451682 Use new SetOption signatures 2021-09-15 18:08:19 +02:00
Craig Scott
1aa4f97c97 cmCTestGenericHandler: Remove unused Command member
This was causing a cppcheck warning about an uninitialized member in
the constructor. Since nothing was using it, remove it.
2021-05-08 16:32:43 +10:00
Vitaly Stakhovsky
f6e7d5f3a0 Reduce the scope of temporary cmProp variables and other improvements 2020-11-05 11:07:39 -05:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Vitaly Stakhovsky
825b04c67a cmCTest: Members accept std::string parameters 2020-07-27 10:58:39 -04:00
Regina Pfeifer
0aa8a2ab8b cmCTest*Command: Port to cmArgumentParser 2019-09-20 13:27:30 +02:00
Zack Galbreath
2a34d0ac36 ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE
Set this in a CTest script to explicitly define what the current revision
will be reported as in Update.xml.
2019-05-07 10:45:47 -04:00
Regina Pfeifer
b172a81d55 cmCTest: Use concrete accessor functions for TestingHandlers 2019-03-20 11:39:14 -04:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02: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
3849164454 CTest: fix include-what-you-use violations 2016-08-25 09:34:37 -04:00
Daniel Pfeifer
1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04: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
Ben Boeckel
06b310b5d5 cmCTestGIT: add an option to initialize submodules on update
Currently, CTest will not initialize any submodules within the already
checked out source tree. Add an option to do so. The use case for not
doing so is that some submodules may not be necessary for the current
test and keeping network usage down may be important.
2016-04-01 15:50:31 -04:00
Zack Galbreath
645ad117e1 ctest_update: Add QUIET option 2015-02-23 10:01:59 -05:00
Bill Hoffman
39b5df2f37 ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version
This allows ctest_update to get the current version without actually
changing the repository.  This is useful when using Jenkins or an
external project to update the source to a specific version, but you
still want the current version to show up in CDash.
2014-08-18 11:21:36 -04:00
Pedro Navarro
970c82348b ctest_update: Add support for Perforce p4 client
Teach the ctest_update implementation to use the p4 command-line
client to perform updates and extract the list of changes.

Add a CTest.UpdateP4 test like those that exist already for the other
version control tools.  Make the test available when p4 and the p4d
server are found.  During the test launch p4d in the background to
serve a repository from the test directory.  Then direct the client
toward this server for the duration of the test.
2013-10-26 10:24:15 -04:00
Nils Gladitz
9ace801578 ctest_update: Tell svn not to prompt interactively (#13024)
While at it, add SVNOptions/CTEST_SVN_OPTIONS configuration settings to
add options to all svn invocations instead of just "svn update".
2012-09-25 13:36:47 -04:00
Brad King
2eae651acc ctest_update: Support custom Git update command
Define CTest configuration variable CTEST_GIT_UPDATE_CUSTOM to set a
custom command line for updating Git-managed source trees.
2010-06-08 16:12:28 -04:00
Brad King
e1548142fb CTest: Move initial checkout to ctest_start()
In CTest command-driven script mode we support starting without a source
tree.  Previously the ctest_start() command would do some initialization
but could not do anything that required CTestConfig.cmake from the input
source tree.  Later, ctest_update() would run CTEST_CHECKOUT_COMMAND to
create the source tree, and then re-initialize everything.  This
delayed-initialization approach led to many complicated cases of which
only some worked.  For example, the second initialization only worked
correctly in Nightly mode and simply failed for Experimental and
Continuous builds.

A simpler solution is to run CTEST_CHECKOUT_COMMAND during ctest_start()
and then have a single initialization path.  In principle this change in
behavior could break scripts that set the checkout command after
ctest_start() but before ctest_update().  However, the convention we've
always followed has been to set all variables before ctest_start().

See issue #9450.
2009-11-24 08:58:59 -05:00
Brad King
96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
Brad King
d4d467dbd5 ENH: Teach CTest to handle Mercurial repositories
This creates cmCTestHG to drive CTest Update handling on hg-based work
trees.  Currently we always update to the head of the remote tracking
branch (hg pull), so the nightly start time is ignored for Nightly
builds.  A later change will address this.

See issue #7879.  Patch from Emmanuel Christophe.  I modified the patch
slightly for code style, to finish up some parsing details, and to fix
the test.
2009-07-10 11:08:05 -04:00
Brad King
a524e07152 ENH: Teach CTest to handle Bazaar repositories
This creates cmCTestBZR to drive CTest Update handling on bzr-based work
trees.  Currently we always update to the head of the remote tracking
branch (bzr pull), so the nightly start time is ignored for Nightly
builds.  A later change will address this.  Patch from Tom Vercauteren.
See issue #6857.
2009-05-14 16:13:52 -04:00
Brad King
9c17cbeb44 ENH: Teach CTest to handle git repositories
This creates cmCTestGIT to drive CTest Update handling on git-based work
trees.  Currently we always update to the head of the remote tracking
branch (git pull), so the nightly start time is ignored for Nightly
builds.  A later change will address this.  See issue #6994.
2009-04-22 09:19:06 -04:00
Andy Cedilnik
12cc89a8e5 BUG: Try to fix the problem of bad test names 2006-07-11 15:58:07 -04:00
Ken Martin
aae0bcdacf STYLE: fix line length 2006-05-10 13:50:44 -04:00
Andy Cedilnik
337362dfcf COMP: Return 0 instead of false 2006-03-29 12:33:41 -05:00
Andy Cedilnik
386900bfdd ENH: Several cleanups and make sure things get propagated where they should. Also, allow to load CTest custom files to the actual ctest -S script 2006-03-29 12:01:24 -05:00
Ken Martin
3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -05:00
Andy Cedilnik
862f5df25c STYLE: Fix some style issues 2006-03-10 15:03:09 -05:00
Andy Cedilnik
6503a0eecc STYLE: Fix some style issues 2006-03-09 11:17:10 -05:00
Andy Cedilnik
d9ed857c8c ENH: Set update options 2005-08-18 10:02:47 -04:00
Andy Cedilnik
1b578d3180 ENH: Several improvements with the way things are handled. Also, support multiple submited files 2005-06-23 13:04:18 -04:00
Andy Cedilnik
d9dc9b54a6 ENH: Add superclass for all commands and handlers. Improve handlers to have initialization code, and start initializing ctest when start is invoked 2005-06-17 13:04:56 -04:00