summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib
Commit message (Collapse)AuthorAgeFilesLines
* CTest: Improve error handling when reading resource spec fileKyle Edwards2019-12-271-52/+70
| | | | Fixes: #20079
* Tests: Fix testCTestResourceSpec struct initialization for some compilersMichael Dickens2019-12-181-37/+36
| | | | | | | | 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
* CTest Resource Allocation: Add test for spec file with no versionKyle Edwards2019-11-262-0/+5
|
* CTest: Clarify that resource requirements can be splitKyle Edwards2019-11-251-0/+3
| | | | | | | Add a note to the documentation to clarify this, and add test cases to ensure it. Fixes: #19987
* CTest: Add version field to resource spec fileKyle Edwards2019-11-2534-0/+185
| | | | Fixes: #20007
* Tests: Fix reliance on undefined behavior of cm::optionalKyle Edwards2019-11-131-36/+48
| | | | | | | | | | | 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
* CTest: Rename hardware -> resources for source codeCraig Scott2019-11-0522-53/+53
|
* CTest: Rename PROCESSES test property to RESOURCE_GROUPSBrad King2019-11-052-6/+7
| | | | | | | | | | | | 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
* CTest: Add bin-packing algorithmKyle Edwards2019-10-022-0/+301
| | | | | | | 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.
* CTest: Add cmCTestHardwareAllocator classKyle Edwards2019-10-022-0/+427
|
* CTest: Add parser for hardware spec fileKyle Edwards2019-10-0220-0/+230
|
* CTest: Add lexer for PROCESSES propertyKyle Edwards2019-10-022-1/+140
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-0119-59/+62
| | | | | 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.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-205-7/+7
| | | | | | | | | | | | | | 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
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-1/+1
| | | | | | 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.
* clang-tidy: Fix bugprone-exception-escape diagnostic in test codeBrad King2019-09-091-1/+2
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-1/+1
|
* IWYU: Add missing cstddef includes for size_t and nullptr_tBrad King2019-09-031-0/+1
| | | | The IWYU tool we use for CI now diagnoses these.
* Source: Add cm::optionalKyle Edwards2019-08-232-0/+691
|
* Merge topic 'cmStringAlgorithms_ulong'Kyle Edwards2019-08-162-16/+35
|\ | | | | | | | | | | | | 935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3681
| * cmStringAlgorithms: Add cmStrToLong and cmStrToULongSebastian Holtermann2019-08-102-16/+35
| | | | | | | | | | | | | | | | 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.
* | cmStringAlgorithms: Add cmRemoveQuotesSebastian Holtermann2019-08-091-0/+23
|/ | | | | - Add `cmRemoveQuotes` function to cmStringAlgorithms - Remove unused removeQuotes inline functions
* Tests: testStringAlgorithms: Add cmTrimWhitespace, cmEscapeQuotes, cmTokenizeSebastian Holtermann2019-08-051-0/+37
| | | | | Extend the testStringAlgorithms test with tests for `cmTrimWhitespace`, `cmEscapeQuotes` and `cmTokenize`.
* Tests: Add CMakeLib.testStringAlgorithms testSebastian Holtermann2019-08-012-0/+135
|
* modernize: manage cmCommand instances using unique_ptr.Marc Chevrier2019-07-141-1/+0
|
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-1/+2
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-0/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* cmUVProcessChain: Add cmUVProcessChainKyle Edwards2019-05-073-0/+411
| | | | | | | | | This class is ultimately intended as a replacement for cmsys::Process. It spawns a series of processes using libuv, piping the output of each command into the next. Note: input support has not yet been implemented because write support has not yet been implemented on cmUVStreambuf.
* cmUVStreambuf: Add std::streambuf implementation for uv_stream_tKyle Edwards2019-04-252-1/+460
| | | | | This will allow std::istream/std::ostream-based interaction with processes spawned by libuv.
* cmUVHandlePtr: Add cm::uv_loop_ptrKyle Edwards2019-04-251-1/+49
|
* cmSystemTools: Fix StringToULong to reject negative numbersBrad King2019-04-111-0/+17
| | | | Fixes: #19161
* Merge topic 'argument-parser'Brad King2019-04-092-0/+149
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | b783e62533 cmExecuteProcessCommand: Port to cmArgumentParser 9bddb03f31 cmParseArgumentsCommand: Port to cmArgumentParser 45edf1ad66 Retire cmCommandArgumentsHelper f5acecaa6f cmExportCommand: Port to cmArgumentParser e6b6bb0618 cmInstallCommand: Port to cmArgumentParser 4336a29edd cmFileCommand: Port to cmArgumentParser 4359fe133b Introduce cmArgumentParser Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Leonid Pospelov <pospelovlm@yandex.ru> Merge-request: !3137
| * Introduce cmArgumentParserRegina Pfeifer2019-04-042-0/+149
| |
* | cmRST: Fix crash on empty markup blockBrad King2019-04-052-0/+8
|/
* testRange: Make sure tests can actually failRegina Pfeifer2019-03-201-1/+1
|
* cm_utf8: add an is_valid functionBen Boeckel2019-03-181-0/+78
|
* cm_utf8: reject codepoints above 0x10FFFFBen Boeckel2019-03-141-4/+2
| | | | | These are invalid because the Unicode standard says so (because UTF-16 as specified today cannot encode them).
* cm_utf8: reject UTF-16 surrogate half codepointsBen Boeckel2019-03-141-2/+2
|
* testUTF8: add more test casesBen Boeckel2019-03-141-6/+16
|
* testUTF8: comment why sequences are invalidBen Boeckel2019-03-141-2/+6
|
* cmRange: Add unit testsRegina Pfeifer2019-02-212-0/+46
|
* Fix most clang -Wextra-semi-stmt warnings in C++ filesSean McBride2019-01-152-11/+13
| | | | Suppress one in code generated by flex.
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-1/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* String: Add str_if_stable() as a const alternative to str()Brad King2018-12-121-0/+59
| | | | | | | | | | | | | | | | The `str()` method must be non-const because it may need to internally mutate the representation of the string in order to have an owned `std::string` instance holding the exact string (not a superstring). This is inconvenient in contexts where we can ensure that no mutation is needed to get a `std::string const&`. Add a `str_if_stable() const` method that returns `std::string const*` so we can return `nullptr` if if mutation would be necessary to get a `std::string const&`. Add supporting `is_stable() const` and `stabilize()` methods to check and enforce stable availability of `std::string const&`. These can be used to create `String const` instances from which we can still get a `std::string const&` via `*str_if_stable()` by maintaining the stability invariant at runtime.
* String: Add support for a ""_s string literal syntaxBrad King2018-12-121-2/+47
| | | | | Create a `static_string_view` type that binds only to the static storage of string literals. Teach `cm::String` to borrow from these implicitly.
* String: Add 'borrow' member to construct borrowing instancesBrad King2018-12-121-0/+32
| | | | | | This will allow creation of `cm::String` instances that borrow from non-owned storage. It is the caller's responsibility to ensure that no copy of the instance outlives the borrowed buffer.
* String: Add support for concatenation by operator+Brad King2018-12-121-0/+101
| | | | | | Use expression templates to collect the entire expression and pre-allocate a string with the final length before concatenating the pieces.
* String: Add a custom string typeBrad King2018-12-122-0/+1111
| | | | | | | | | | | | | | Create a `cm::String` type that holds a view of a string buffer and optionally shares ownership of the buffer. Instances can either borrow longer-lived storage (e.g. static storage of string literals) or internally own a `std::string` instance. In the latter case, share ownership with copies and substrings. Allocate a new internal string only on operations that require mutation. This will allow us to recover string sharing semantics that we used to get from C++98 std::string copy-on-write implementations. Such implementations are not allowed by C++11 so code our own in a custom string type instead.
* clang-tidy: Fix readability-static-accessed-through-instanceRegina Pfeifer2018-11-211-3/+3
| | | | Enable the check in .clang-tidy and fix all warnings.