summaryrefslogtreecommitdiffstats
path: root/Tests
Commit message (Collapse)AuthorAgeFilesLines
* ctest: add option --stop-on-failureJohnny Jazeix2020-04-206-0/+51
| | | | | | To stop the tests once one has failed Fixes: #16628
* Merge topic 'FindPython-dev-subcomponents'Brad King2020-04-178-3/+148
|\ | | | | | | | | | | | | | | c1b4044d3e FindPython: add sub-components to Development component Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !4616
| * FindPython: add sub-components to Development componentMarc Chevrier2020-04-168-3/+148
| | | | | | | | Fixes: #20425
* | Merge topic 'cat_cmd_20557'Kyle Edwards2020-04-1610-0/+49
|\ \ | | | | | | | | | | | | | | | | | | a625f30785 cmake -E: add cat command. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4600
| * | cmake -E: add cat command.Johnny Jazeix2020-04-1510-0/+49
| | | | | | | | | | | | | | | | | | Concatenate files and print on the standard output. FIXES: #20557
* | | Merge topic 'cuda_architectures'Brad King2020-04-1633-35/+110
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 21131ca60c CUDA: Add CudaOnly.CompileFlags test f0931b0790 CUDA: Convert tests to use CUDA_ARCHITECTURES e98588aaba CUDA: Add CUDA_ARCHITECTURES target property Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Patrick Stotko <stotko@cs.uni-bonn.de> Merge-request: !4568
| * | | CUDA: Add CudaOnly.CompileFlags testRaul Tambre2020-04-153-0/+33
| | | | | | | | | | | | | | | | Covers passing compile flags explicitly for both NVCC and Clang.
| * | | CUDA: Convert tests to use CUDA_ARCHITECTURESRaul Tambre2020-04-1516-35/+16
| | | |
| * | | CUDA: Add CUDA_ARCHITECTURES target propertyRaul Tambre2020-04-1515-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplifies CUDA target architecture handling. Required for Clang support as Clang doesn't automatically select a supported architecture. We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it. Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC. Implements #17963.
* | | | Merge topic 'makefile-target-special'Brad King2020-04-164-14/+34
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a4173ef165 Tests: Enable coverage of special chars in include dirs for Makefiles d74e651b78 Makefiles: Re-implement makefile target path escaping and quoting 031bfaa865 Makefiles: Factor out makefile target path escaping and quoting ca343dad07 Makefiles: Convert paths with '#' on command-lines to short path on Windows af7de05853 Makefiles: Do not use '\#' escape sequence with Windows-style make tools 1639ee70ef cmDepends: Update types to always use a Makefile generator 413d26030f cmGlobalNinjaGenerator: Remove outdated comment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4605
| * | | Tests: Enable coverage of special chars in include dirs for MakefilesBrad King2020-04-153-13/+33
| | | | | | | | | | | | | | | | Issue: #20555
| * | | Makefiles: Do not use '\#' escape sequence with Windows-style make toolsBrad King2020-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit fbf7a92975 (Makefile: Handle '#' in COMPILE_OPTIONS, 2014-08-12, v3.1.0-rc1~174^2) we escape `#` as `\#` in `flags.make` variable assignments so that they are not treated as a comment. Windows-style make tools like NMake do not interpret backslashes in that way. Other means will be needed to handle `#` in contexts where it is even possible. The test suite is not covering this for NMake anyway, and actually has a workaround in `Tests/TryCompile` for the old behavior, which we can now update.
* | | | Merge topic 'cpack-nsis-dpi-aware'Brad King2020-04-152-0/+9
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | d6840a4f3c CPack/NSIS: Add option for setting DPI-aware Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4607
| * | | CPack/NSIS: Add option for setting DPI-awareJohnny Jazeix2020-04-142-0/+9
| | |/ | |/| | | | | | | | | | | | | | | | See https://nsis.sourceforge.io/Reference/ManifestDPIAware for more information. Fixes: #17724
* | | Merge topic 'sort_list_natural_20563'Brad King2020-04-141-0/+23
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | da99eca1e7 list: add NATURAL sorting on SORT sub-command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4602
| * | | list: add NATURAL sorting on SORT sub-commandJohnny Jazeix2020-04-131-0/+23
| |/ / | | | | | | | | | Fixes: #20563
* | | clang-tidy: address readability-else-after-return lintBen Boeckel2020-04-132-2/+4
| |/ |/|
* | Merge topic 'include-dir-special'Brad King2020-04-132-0/+29
|\ \ | | | | | | | | | | | | | | | | | | | | | 9be48c4d0b Tests: Add coverage for special characters in include directories dc0dc974a9 Xcode: Fix quoting of paths with square brackets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4591
| * | Tests: Add coverage for special characters in include directoriesBrad King2020-04-102-0/+29
| |/ | | | | | | | | | | | | | | | | We have tests for special characters in preprocessor definitions and custom command line arguments. Add such a test for include directories. Currently the Makefiles generators do not escape paths in `depend.make` in all cases, so leave a FIXME comment and skip the test for those. Issue: #20555
* | Merge topic 'find_program-exe-no-read'Brad King2020-04-103-0/+9
|\ \ | | | | | | | | | | | | | | | | | | 86e6349ef7 find_program: Find programs that are executable but not readable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4571
| * | find_program: Find programs that are executable but not readableVladimir Menshakov2020-04-093-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | `find_program` internally uses `cmSystemTools::FileExists` which calls `access(R_OK)` instead of `access(X_OK)`. Use `cmSystemTools::IsFileExecutable` instead to fix this issue. An example of such a program is `sudo`. Fixes: #10468
* | | Merge topic 'googletest-skipped'Brad King2020-04-104-0/+48
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | 89a843d6ea GoogleTest: Add testcase for skipped tests 98868dad1c GoogleTest: Add support for skipped tests Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4586
| * | GoogleTest: Add testcase for skipped testsAlexander Stein2020-04-104-0/+48
| |/ | | | | | | | | This simply runs a mocked test case which uses the prefix for signaling a skipped test. CTest's output is checked for a skipped test result.
* | file(UPLOAD): Add support for TLS_VERIFY and TLS_CAINFOHarry Mallon2020-04-0813-0/+28
|/ | | | | * Improve and test err messages when TLS_VERIFY and TLS_CAINFO are not set in file(DOWNLOAD) and file(UPLOAD).
* Tests: Fix get_filename_component PROGRAM test to use an executableBrad King2020-04-072-4/+5
|
* Merge topic 'file-GetRuntimeDependencies_support_cross_compilation'Brad King2020-04-076-0/+32
|\ | | | | | | | | | | | | f867423aa2 file: GetRuntimeDependencies use CMAKE_OBJDUMP when applicable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4538
| * file: GetRuntimeDependencies use CMAKE_OBJDUMP when applicableRobert Maynard2020-04-066-0/+32
| | | | | | | | | | | | | | | | | | On machines where the gnu bin utils are prefixed, or suffixed the file(GET_RUNTIME_DEPENDENCIES ) command would fail without explicitly setting the location of objdump. Now we pre-populate the variables used to find objdump based on the gnu bin utils, so that these use cases are better supported
* | Merge topic 'llvm-rc-include-path'Brad King2020-04-071-8/+8
|\ \ | | | | | | | | | | | | | | | | | | 35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4570
| * | llvm-rc: Restore include path for data after explicit preprocessingThomas Bernard2020-04-061-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) with llvm-rc we explicitly preprocess RC source files and then compile separately without -I flags. This broke cases where the RC source references data files adjacent to itself or in the include path. This change adds the expansion of the include paths when calling the llvm-rc in order for the resource files to be picked up correctly by llvm-rc. Since the RC compiled file is first preprocessed, the file being compiled by llvm-rc resides in the build directory. In order for llvm-rc to find the resource data specified relative to the .rc file being compiled, the source file path is preppended in the include list so that the original source path takes priority over all the other includes paths specified. A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include directive work properly for llvm-rc. Checks on the rc.exe showed that the syntax change doesn't affect it's proper operation. Fixes: #20529
| * | Merge topic 'ctest-timeout-report' into release-3.17Brad King2020-03-272-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 7fda917fa4 CTest: Fix reported duration on timeout when grindchild keeps pipes open Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4530
* | \ \ Merge topic 'fetchcontent-download-no-extract'Brad King2020-04-063-0/+11
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0331092ce6 FetchContent: Add support for DOWNLOAD_NO_EXTRACT Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4555
| * | | | FetchContent: Add support for DOWNLOAD_NO_EXTRACTCraig Scott2020-04-033-0/+11
| | | | | | | | | | | | | | | Fixes: #20526
* | | | | Merge topic 'parallel-lzma-compression'Brad King2020-04-065-0/+20
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b3bacf0152 cmCPackArchiveGenerator: support multithreaded compression b71d385ed4 cmCPackArchiveGenerator: support setting archive options 948aa8bd1c cmArchiveWrite: support setting archive filter options b9c17de023 cmArchiveWrite: split out opening the file Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Cristian Adam <cristian.adam@gmail.com> Merge-request: !3195
| * | | | | cmCPackArchiveGenerator: support multithreaded compressionBen Boeckel2020-04-035-0/+20
| | | | | |
* | | | | | Merge topic 'ctest-resource-file-cache'Brad King2020-04-0610-16/+64
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 060d2ce269 CTest: Add CTEST_RESOURCE_SPEC_FILE variable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4564
| * | | | | CTest: Add CTEST_RESOURCE_SPEC_FILE variableKyle Edwards2020-04-0210-16/+64
| | | | | |
* | | | | | Merge topic 'pch-ios-multi-arch'Brad King2020-04-031-6/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f593b354da PCH: Add support for multi architecture iOS projects Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4561
| * | | | | | PCH: Add support for multi architecture iOS projectsCristian Adam2020-04-021-6/+3
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | Fixes: #20497
* | | | | | Merge topic 'ExternalProject-no-extract-bool'Brad King2020-04-031-0/+9
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2c4bb705e8 ExternalProject: allow `DOWNLOAD_NO_EXTRACT OFF` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4562
| * | | | | ExternalProject: allow `DOWNLOAD_NO_EXTRACT OFF`Ben Boeckel2020-04-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: #20531
* | | | | | Merge topic 'link-libs-config-case'Brad King2020-03-314-0/+28
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2af18704fd Merge branch 'backport-3.16-link-libs-config-case' 3f976bf201 target_link_libraries: Fix regression in case of $<CONFIG> genex 5a95b5e091 target_link_libraries: Fix regression in case of $<CONFIG> genex Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4544
| * | | | | target_link_libraries: Fix regression in case of $<CONFIG> genexBrad King2020-03-304-0/+28
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit b8626261e9 (Precompile headers: Add methods to generate PCH sources, 2019-07-13, v3.16.0-rc1~182^2~4) we look up source files for a target using an upper-case configuration even though an original-case name is sufficient. Since commit 36ded610af (PCH: Generate sources during Compute step, 2019-10-05, v3.16.0-rc1~2^2) the source file lookup is the first time we compute many on-demand structures that depend on the configuration name. This caused the `$<CONFIG>` generator expression to evaluate to the upper-case configuration name in some cases where we used original-case before. Fix this by switching the source file lookup to the original-case config name. Add a test covering the symptom that led to the discovery of this problem. Fixes: #20517
* | | | | Merge topic 'vs-non-built-file-item-metadata'Brad King2020-03-309-1/+122
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0723e04f7a VS: Add documentation for VS_SETTINGS and VS_SOURCE_SETTINGS_<tool>. 2ca1102f83 VS: Test VS_SETTINGS and VS_SOURCE_SETTINGS_<tool> properties. f00e1b816d VS: Add VS_SOURCE_SETTINGS_<tool> target property 2ce42f281f VS: Add VS_SETTINGS source file property 53116d3942 VS: Use unordered_map to write HLSL settings. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4498
| * | | | | VS: Test VS_SETTINGS and VS_SOURCE_SETTINGS_<tool> properties.Matt Davies2020-03-269-1/+122
| | | | | |
* | | | | | Merge topic 'gtest_discover_tests_cross_compile_support'Brad King2020-03-3015-34/+156
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3b4838b57f GoogleTest: Add tests for MultiConfig discovery in PRE_TEST mode 1ba4cb565e GoogleTest: Parameterize tests to check PRE_TEST/POST_BUILD discovery mode 75e82a13db GoogleTest: Add new DISCOVERY_MODE option to gtest_discover_tests 889a7146ff GoogleTestAddTests: Refactor into callable method Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4078
| * | | | | | GoogleTest: Add tests for MultiConfig discovery in PRE_TEST modeRyan Thornton2020-03-275-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PRE_TEST makes it possible to properly distinguish between test cases that exist only in certain configurations. In the new test scenario, debug tests are disabled in release builds, and release tests are disabled in debug builds when a multi config generator is used. Note, this is a bit of a hack and *only* works for PRE_TEST mode. POST_BUILD makes no attempt to get this right. It preserves the status quo and you obtain the tests that were last discovered. See further discussion in !4078 Ideally, the POST_BUILD behavior could be fixed by using generator expressions in OUTPUT and BYPRODUCT expressions. Then you could do something like: set(ctest_include_file "${ctest_file_base}_include-$<CONFIG>.cmake") set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake") Once #12877 lands, maybe this can be revisited. Co-authored-by: Ryan Thornton <ThorntonRyan@JohnDeere.com> Co-authored-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
| * | | | | | GoogleTest: Parameterize tests to check PRE_TEST/POST_BUILD discovery modeRyan Thornton2020-03-2711-34/+68
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, the unit tests are ran twice -- once with POST_BUILD (i.e. default mode) and again with PRE_TEST (i.e. new discovery mode). Both modes of setting gtest discovery mode are also tested: 1. Using the global override (i.e. CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE) 2. Explicitly passing DISCOVERY_MODE in calls to gtest_discover_tests (in GoogleTestDiscoveryTimeout.cmake) The goal is to show that the new PRE_TEST discovery mode does not break existing behavior (i.e. should not break POST_BUILD mode) and should also pass the same tests in the same way. A few non trivial implementation details worth noting: 1. Refactoring discovery_timeout_test into own project Originally, I tried doing: ``` run_GoogleTest(POST_BUILD) run_GoogleTest(PRE_TEST) ``` Without changing the internal structure of run_GoogleTest. But since discovery_timeout_test is part of the same project as the other tests, and CTest include files always get evaluated and that's where test discovery occurs, this means every other test now notices the timeout problem when running in PRE_TEST mode. As a result, keeping the existing test structure meant that each existing test (and any new test) would need to have its own PRE_TEST / POST_BUILD variant for stderr and stdout in order to handle the case where discovery_timeout_test timed out. This exponential increase in test output files introduced unnecessary complexity and made it more cumbersome to work on test cases. Why should an unrelated test case care about discovery_timeout_test? So, to fix that issue, the tests were broken apart into two main groups: 1. run_GoogleTest_discovery_timeout (the test dealing with discovery_timeout_test) 2. run_GoogleTest (everything else) This isolates the PRE_TEST / POST_BUILD timeout variants to a single test case. And the other test cases remain unchanged -- further driving home the point that DISCOVERY_MODE shouldn't change existing behavior. 2. Different number of PRE_TEST / POST_BUILD file variants On the PRE_TEST path, different build systems / compilers (i.e. MSBuild and ninja/gcc) produces different build output when building discovery_timeout_test, but we don't actually care what it is, just as long as it builds successfully. This the fundamental difference in behavior between POST_BUILD (which would have failed) and PRE_TEST (which doesn't) and is the reason why we don't need a GoogleTest-discovery-build-result.txt or GoogleTest-discovery-build-stdout.txt 3. Fix flaky discovery timeout test The test expects to see: > Output: > timeout > case. But sometimes, the test would only produce: > Output: > timout In certain environments, specifically when built with OpenWatcom 1.4, and while the build server was under heavy load (i.e. running many tests in parallel), std::endl behaves inconsistently and doesn't completely flush std::cout when the program is terminated due to timeout. This results in inconsistent test failures because the actual output doesn't fully match what's expected. At first we tried adding an additional: std::cout << std::flush That didn't work. But using C-style printf() and fflush() appears to do the trick: > This time I managed to get on the machine while it was still busy doing other nightly builds > and could reproduce the problem reliably. With that I was finally able to find a fix. > It turns out my earlier hypothesis that C++ stream flushing was not working on the old compiler was correct, > but even .flush() is not enough. > I changed it to use C-style printf() and fflush() and now the test passes on that build. > -- Brad King <brad.king@kitware.com> Co-authored-by: Ryan Thornton <ThorntonRyan@JohnDeere.com> Co-authored-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
* | | | | | Merge topic 'pch-warn-invalid'Brad King2020-03-274-1/+42
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2ce08e5489 PCH: add an option to disable `-Winvalid-pch` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4499
| * | | | | | PCH: add an option to disable `-Winvalid-pch`Cristian Adam2020-03-264-1/+42
| |/ / / / / | | | | | | | | | | | | | | | | | | Fixes: #20295
* | | | | | Merge topic 'export-error-on-multuple-calls'Brad King2020-03-277-1/+52
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0cd20e8f62 export(): raise an error on multiple calls with same FILE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4510