Commit Graph

151 Commits

Author SHA1 Message Date
Brad King
9fc8e827c8 Tests: Fix -Wsuggest-destructor-override warning in testCMExtMemory 2020-07-28 10:06:31 -04:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Brad King
2282be37a5 Merge topic 'stl-support-filesystem-path'
d654bf3449 STL Support: Add cm::filesystem::path in <cm/filesystem>
e5798126fc STL Support: introduce dedicated configuration file
4408f34cfe STL Support: Add function cm::quoted in <cm/iomanip>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4968
2020-07-13 07:59:43 -04:00
Tobias Ribizel
f38e4a1871 Tests: Add cases for CTest cuda-memcheck parser 2020-07-09 19:08:34 +02:00
Marc Chevrier
d654bf3449 STL Support: Add cm::filesystem::path in <cm/filesystem> 2020-07-09 17:02:42 +02:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Brad King
68a59ab288 Merge topic 'stl-support'
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4689
2020-05-01 08:27:37 -04:00
Marc Chevrier
8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Ben Boeckel
99663a5157 IWYU: mark <cstddef> as needed
Newer IWYU is not seeing this as necessary for `_GLIBCXX_USE_CXX11_ABI`.
2020-04-29 11:16:44 -04:00
Ben Boeckel
24a9fed5d9 IWYU: mark <cstddef> as needed
Newer IWYU is not seeing them as needed for `size_t`.
2020-04-29 11:16:44 -04:00
Brad King
89a3d33d11 Merge topic 'automoc-using-depfiles'
aebfbcaa46 AutoGen: Use depfiles for the XXX_autogen ninja targets
f765fdea03 AutoGen: Use moc's feature to output dependencies
f8c505d4b3 Add a parser for GCC-style depfiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jan Niklas Hasse <jhasse@bixense.com>
Merge-request: !4221
2020-01-30 09:52:33 -05:00
Joerg Bornemann
f8c505d4b3 Add a parser for GCC-style depfiles
Introduce the function cmReadGccDepfile that parses a GCC-style depfile
and returns its content. The implementation uses a lexer that is
modeled after the re2c implementation in Ninja.

The sample files of the autotest have been created with gcc 8.3.0.

This depfile reader is to be used by the Autogen facility to make use
of the depfiles that are generated by Qt's meta object compiler.
2020-01-28 11:16:11 -05:00
Brad King
e4e41d33d6 Merge topic 'cmsting-stl-compatibility'
8f839d02e3 cm::String: enhance compatibility with STL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4281
2020-01-28 10:58:11 -05:00
Marc Chevrier
8f839d02e3 cm::String: enhance compatibility with STL 2020-01-25 18:16:16 +01:00
Marc Chevrier
73d1da4f86 Stl support: cm::append now supports any sequential container 2020-01-24 15:55:32 +01:00
Craig Scott
da9cbeb3e9 Merge topic 'ctest-resource-allocation-spec-message'
b393b32b4b CTest: Improve error handling when reading resource spec file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4162
2019-12-28 19:03:00 -05:00
Kyle Edwards
b393b32b4b CTest: Improve error handling when reading resource spec file
Fixes: #20079
2019-12-27 10:53:52 -05:00
Brad King
1546ee39bd Merge topic 'test-resource-spec-init-lists'
e8dbe4bba1 Tests: Fix testCTestResourceSpec struct initialization for some compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Dickens <michael.dickens@ettus.com>
Merge-request: !4141
2019-12-19 09:51:53 -05:00
Michael Dickens
e8dbe4bba1 Tests: Fix testCTestResourceSpec struct initialization for some compilers
Some compilers do not like the nested `{{{}}}` member initialization
syntax, so use just `{}`.  GCC 4.8 warns about the latter, so add a
suppression.

Fixes: #20097
2019-12-18 05:45:08 -05:00
Marc Chevrier
a38d04c076 Refactoring: introduce header cmext/algorithm with append functions 2019-12-17 10:43:58 +01:00
Brad King
e9e0e401c6 Merge topic 'cmext-memory'
fc3b4caa2e Memory management: cast functions for managed pointers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4064
2019-12-04 14:22:01 -05:00
Kyle Edwards
398dfc1338 Merge topic 'ctest-spec-file-version-test'
59df85194e CTest Resource Allocation: Add test for spec file with no version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4092
2019-11-27 22:48:20 -05:00
Marc Chevrier
fc3b4caa2e Memory management: cast functions for managed pointers 2019-11-27 16:03:04 +01:00
Kyle Edwards
59df85194e CTest Resource Allocation: Add test for spec file with no version 2019-11-26 11:41:56 -05:00
Brad King
3d5227e6b6 Merge topic 'ctest-resource-fixes'
a033bafbe0 Help: Clarify how tests are run if no resource spec file is specified
a64ba0235f CTest: Clarify that resource requirements can be split
f9f294f5fa CTest: Add version field to resource spec file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4080
2019-11-26 09:12:34 -05:00
Kyle Edwards
a64ba0235f CTest: Clarify that resource requirements can be split
Add a note to the documentation to clarify this, and add test cases
to ensure it.

Fixes: #19987
2019-11-25 11:08:27 -05:00
Kyle Edwards
f9f294f5fa CTest: Add version field to resource spec file
Fixes: #20007
2019-11-25 11:08:27 -05:00
Brad King
7ee73962ec Merge topic 'fix-optional-test'
e8bd920df1 Tests: Fix reliance on undefined behavior of cm::optional

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !4049
2019-11-15 09:03:17 -05:00
Kyle Edwards
e8bd920df1 Tests: Fix reliance on undefined behavior of cm::optional
The test for cm::optional assumed that *opt would return a reference
to a non-constructed object if opt.has_value() is false. However, on
certain systems that build CMake with flags to harden the build,
this condition aborts rather than returning the invalid reference.
Fix this by getting the reference only when the cm::optional is
known to actually have a value.

Fixes: #19964
2019-11-13 13:56:22 -05:00
Brad King
016601e5e6 Merge branch 'backport-ctest-resource-groups' 2019-11-05 12:59:16 -05:00
Craig Scott
c544cb6698 CTest: Rename hardware -> resources for source code 2019-11-05 12:08:35 -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
fe5ba71bd0 Tests: Suppress clang scan-build warning in UTF8 test
Clang scan-build 7 reports:

```
Tests/CMakeLib/testUTF8.cxx:12:3: warning: 4th function call argument is an uninitialized value
  printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast<int>(d[0]),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Manual tracing of all call sites shows that all values are initialized.
2019-10-29 11:20:47 -04:00
Kyle Edwards
aee0964851 CTest: Add bin-packing algorithm
This algorithm is used to determine whether or not a test can
execute with the available resources. It uses a recursive largest-
first algorithm to try to place the tests into their respective
slots.
2019-10-02 09:33:54 -04:00
Kyle Edwards
c494b2973a CTest: Add cmCTestHardwareAllocator class 2019-10-02 09:33:54 -04:00
Kyle Edwards
c8f4806943 CTest: Add parser for hardware spec file 2019-10-02 09:33:54 -04:00
Kyle Edwards
bb4a141059 CTest: Add lexer for PROCESSES property 2019-10-02 09:33:54 -04:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Regina Pfeifer
d25a5a7ec9 clang-tidy: modernize-use-auto
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators.  Leave new expressions and cast
expressions for later.
2019-09-10 22:21:41 +02:00
Brad King
8588cdf3a0 clang-tidy: Fix bugprone-exception-escape diagnostic in test code 2019-09-09 13:51:23 -04:00
Regina Pfeifer
62e5f72289 clang-tidy: Replace typedef with using 2019-09-03 13:21:26 -04:00
Brad King
de0a2354fc IWYU: Add missing cstddef includes for size_t and nullptr_t
The IWYU tool we use for CI now diagnoses these.
2019-09-03 11:46:52 -04:00
Kyle Edwards
197c5e12ad Source: Add cm::optional 2019-08-23 08:43:35 -04:00
Kyle Edwards
dcf2beb7de Merge topic 'cmStringAlgorithms_ulong'
935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3681
2019-08-16 14:49:28 -04:00
Sebastian Holtermann
935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong
This adds the following functions to cmStringAlgorithms:
- `cmStrToLong`: moved from `cmSystemTools::StringToLong`
- `cmStrToULong`: moved from `cmSystemTools::StringToULong`

Overloads of the given functions for `std::string` are added as well.
2019-08-10 14:39:03 +02:00
Sebastian Holtermann
27090096ef cmStringAlgorithms: Add cmRemoveQuotes
- Add `cmRemoveQuotes` function to cmStringAlgorithms
- Remove unused removeQuotes inline functions
2019-08-09 12:20:50 +02:00
Sebastian Holtermann
959b97a27f Tests: testStringAlgorithms: Add cmTrimWhitespace, cmEscapeQuotes, cmTokenize
Extend the testStringAlgorithms test with tests for `cmTrimWhitespace`,
`cmEscapeQuotes` and `cmTokenize`.
2019-08-05 11:25:30 +02:00
Sebastian Holtermann
4aa555f9da Tests: Add CMakeLib.testStringAlgorithms test 2019-08-01 11:45:04 +02:00