summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'implicit-lib-gcceh'Brad King2017-11-081-1/+21
|\ | | | | | | | | | | | | 41aacca7 Restore exclusion of "gcc_eh" from implicit link libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1460
| * Restore exclusion of "gcc_eh" from implicit link librariesChristian Pfeiffer2017-11-081-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.9.0-rc1~148^2 (Do not assume GCC libs are linked by all compilers, 2017-05-05) we no longer filter out all `gcc*` implicit link libraries. This allows mixing of gcc and non-gcc compilers across languages. However, this caused a subtle problem with how GCC makes exception handling symbols available to linked binaries. GCC (at least on MinGW) provides two different libraries with exception handling symbols: * gcc_s: A shared library with -fvisibility=default, used by -shared-libgcc. * gcc_eh: A static library with -fvisibility=hidden, used by -static-libgcc. The C compiler (on MinGW) defaults to -static-libgcc and uses gcc_eh. The C++ compiler defaults to -shared-libgcc and uses gcc_s when linking shared libraries and executables so that exceptions can propagate across shared libraries [1]. When linking a mixed-language binary, the C++ compiler should be used along with its choice of gcc_s. In this case gcc_eh should not be added even though the C compiler implies it because gcc_s supersedes it. Since the above-mentioned change, CMake is adding gcc_eh to C++ link lines that also contain C code on MinGW. This causes both gcc_s and gcc_eh to be used, which is incorrect. We can fix this simply by excluding gcc_eh from the C compiler's implicit link libraries. [1] https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Link-Options.html#Link-Options Fixes: #17436
* | gitattributes: prefer `eol=lf` to `crlf=input`Ben Boeckel2017-08-231-1/+1
| | | | | | | | The `crlf` attribute is deprecated in Git.
* | CMakePushCheckState: Fix cmake_push_check_state RESET argumentBrad King2017-07-121-0/+22
| | | | | | | | | | | | | | | | | | This option was added by commit v2.8.12~138^2 (Add cmake_reset_check_state() macro, 2013-07-28) but has never worked. Fix the implementation to refer to macro arguments properly (not as normal variables). Fixes: #17048
* | cmake_host_system_information: Add more keywordsFlorian Maushart2017-06-051-0/+19
|/ | | | | Extend the `cmake_host_system_information()` command to add processor identification keywords.
* ImplicitLinkInfo: Add support for PGI on WindowsChristian Pfeiffer2017-05-201-3/+48
| | | | | | | Since PGI does not write linker directives into objects, the necessary libraries have to be parsed from commandline. PGI does however link the Visual C++ runtime libraries, so they have to be filtered out to ensure no collision with settings of other languages can occur.
* Do not assume GCC libs are linked by all compilersChristian Pfeiffer2017-05-051-30/+30
| | | | | Not all compilers link libgcc and libgcc_s causing trouble when linking C++ code with instance PGI Fortran and C compilers.
* separgs: Migrate tests to RunCMake testsChristian Pfeiffer2017-04-262-26/+0
|
* Merge topic 'mac-implicit-link-no-lto-flag'Brad King2017-04-041-0/+6
|\ | | | | | | | | | | | | 53f17333 CMakeParseImplicitLinkInfo: Ignore ld -lto_library flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !658
| * CMakeParseImplicitLinkInfo: Ignore ld -lto_library flagBrad King2017-04-031-0/+6
| | | | | | | | | | | | | | The `ld` tool in Xcode 8.3 now has a `-lto_library <path>` flag. Ignore the flag instead of accidentally parsing it as `-l` with `to_library`. Fixes: #16766
* | Tests: Fix CMake.GetPrerequisites test config messageBrad King2017-04-032-9/+3
| | | | | | | | | | | | | | | | Since commit v2.8.11~239^2~1 (ProcessorCount test: fix path to cmsysTestsCxx executable, 2013-01-24) we accidentally printed a literal `${CTEST_CONFIGURATION_TYPE}` instead of the actual build configuration. Update the message to use a generator expression to get the real build configuration used.
* | Make CMAKE_HOST_SYSTEM_NAME available in scripting contextGregor Jasny2017-02-191-1/+0
| |
* | Tests: Fix `file://` URLs given to curlBrad King2017-02-103-3/+12
| | | | | | | | | | | | | | Since upstream curl commit curl-7_52_0~131 (URL-parser: for file://[host]/ URLs, the [host] must be localhost, 2016-11-11) we can no longer use URLs of the form `file://c:/...` on Windows. These worked only accidentally before. Use `file:///c:/...` instead.
* | CMakeDetermineCompilerId: check with and without user-specified flagsMichael Maltese2017-02-061-2/+2
|/ | | | | | | | | | | Clang may raise an error when passed a `-march=` option that doesn't correspond to the current target triple. CMake cannot pass the target triple when determining the compiler id because it doesn't know how yet, but it does pass along user-specified flags. This breaks when those user-specified flags include `-march=`. Fix this use case by also trying to find the compiler id without the user-specified flags. Fixes: #16587
* Tests: make tests pass with SOURCE_DATE_EPOCH setBernhard M. Wiedemann2017-01-301-0/+1
| | | | | | | | | Fix tests to account for commit 243aed52 (cmTimestamp: Support SOURCE_DATE_EPOCH to override current time, 2017-01-25). In openSUSE we are running the test-suite as part of the build and that failed in these two places when building everything with `SOURCE_DATE_EPOCH` set.
* CMakeParseImplicitLinkInfo: Add support for MSVC invoked by CUDA nvccBrad King2017-01-121-0/+7
|
* file: Add support for SHA-3 algorithmsBrad King2016-11-105-0/+20
|
* string: Add support for SHA-3 algorithmsBrad King2016-11-105-0/+20
|
* Tests: Update ModuleNotices test for new noticeBrad King2016-09-271-18/+5
|
* string(TIMESTAMP ...): add '%a' and '%b' format specifiersRuslan Baratov2016-09-122-0/+14
| | | | | %b: Abbreviated month name (e.g. Oct). %a: Abbreviated weekday name (e.g. Fri).
* Add additional <= and >= comparison operatorsChuck Atkins2016-08-091-0/+14
| | | | | This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION equivalents to use the combined <= and >= functionality.
* Use string(APPEND) in TestsDaniel Pfeifer2016-07-272-4/+4
| | | | | | | Automate with: find Tests -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* CMakeParseImplicitLinkInfo: Exclude libclang_rt librariesBrad King2016-07-111-0/+6
| | | | | | | | These libraries are used for Clang runtime analysis support with flags like `-fsanitize=memory` and are not actually implicitly linked libraries. Fixes #16194.
* PushCheckStateTest: Update test to check CMAKE_EXTRA_INCLUDE_FILESJean-Christophe Fillion-Robin2016-03-311-0/+5
|
* PushCheckStateTest: Test all variables managed by the moduleJean-Christophe Fillion-Robin2016-03-311-9/+43
|
* PushCheckStateTest: Fix syntax warningJean-Christophe Fillion-Robin2016-03-311-2/+2
| | | | | | | This commit fixes the following warning originally introduced in 1325260 (Add macros cmake_push/pop_check_state() as discussed on the list.) Argument not separated from preceding token by whitespace.
* CMake: Extend TIMESTAMP sub-commands with new unix time format specifierJose-Luis Blanco-Claraco2016-02-182-0/+28
| | | | | | | | The new `%s` format specifier is substituted by file()/string() `TIMESTAMP` sub-commands with the number of seconds since unix-epoch (1970-01-01 00:00:00 UTC). Co-Author: Nils Gladitz <nilsgladitz@gmail.com>
* CMakeParseImplicitLinkInfo: Do not match "VAR=..." as link line (#15737)Brad King2015-09-111-0/+7
| | | | | | | | | | | | | | | When compiling with LDFLAGS='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' the compiler output includes a line like COLLECT_GCC_OPTIONS='-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' ... that our link line regex matches due to an argument ending in "-ld". Since it is not really the link line no implicit link information is dectected. Exclude "VAR=..." lines from consideration as link lines to fix this.
* Tests: Move command failure cases into RunCMake infrastructureBrad King2015-07-1438-249/+0
| | | | | | | Move failure cases from the CMake.{If,List,While,GetProperty} tests over to the RunCMake.{if,list,while,get_property} tests to use the more modern infrastructure. This also avoids using REGEX_ESCAPE_STRING to try to regex-match full paths.
* Tests: Fix CheckSourceTree test when build is under source (#15566)Brad King2015-05-141-1/+11
| | | | | | Since the build tree will populate content under the source tree the test cannot reliably check that the source tree is pristine. Simply skip most of the test in this case.
* Tests: Fix CMake.ELF test with read-only source (#15489)Bill Newcomb2015-04-011-1/+1
| | | | | | | When the cmake sources are all set to read-only (e.g. after importing into perforce), the CMake.ELF test fails because the copy of the binary is also read-only and cannot be modified. Fix this by copying the binary without source permissions.
* Tests: Add more signature tests to RunCMake.configure_file testBrad King2015-03-0910-66/+0
| | | | | | | Move the test cases from Tests/CMakeTests/ConfigureFileTest.cmake.in over to use the RunCMake.configure_file infrastructure. This does much more robust verification of CMake output for each test case, and would have caught the regression fixed in our parent commit.
* Tests: Fix CheckSourceTree test for newer GitBrad King2014-12-161-2/+2
| | | | | The output of 'git status' no longer starts each line in '#'. Match that optionally.
* string: Tolerate SUBSTRING length exceeding end indexDomen Vrankar2014-11-132-6/+9
| | | | | | string SUBSTRING command now ignores length if it points past end of string and uses end of string instead. String SUBSTRING tests now cover more corner cases.
* cmSystemTools: reimplement verson comparison without sscanf()Rolf Eike Beer2014-10-311-0/+2
| | | | | This now has the advantage that it works with version strings with any number of components.
* extend the testing for version comparisonRolf Eike Beer2014-10-291-6/+80
| | | | | This now checks also the negative outcome of the comparision operation, and adds a bunch more different cases.
* Replace string(REGEX REPLACE) with string(REPLACE) where possibleRolf Eike Beer2014-04-141-2/+2
| | | | The simple replacement is much faster.
* Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)Rolf Eike Beer2014-04-141-2/+2
| | | | | | The matches have already been calculated and can simply be taken from CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very similar regular expressions.
* file DOWNLOAD: Test non-zero return status.Matt McCormick2014-01-161-0/+13
|
* file DOWNLOAD: Add test for bad hash.Matt McCormick2014-01-162-0/+14
|
* Drop use of configure_file IMMEDIATE optionDaniele E. Domenichelli2013-11-131-1/+1
| | | | | | Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08) we no longer need to use the configure_file IMMEDIATE option to support compatibility modes less than 2.0.
* get_property: Drop test for builtin property documentationBrad King2013-10-161-11/+0
| | | | | Property documentation is no longer builtin, so the get_property command will be unable to return the documentation. Drop the test for it.
* Tests: Verify policies are introduced only in "official" versionsDavid Cole2013-08-282-0/+163
| | | | | | | | | | | | | | | | | | | | | Add the CMake.PolicyCheck test. This test uses "git grep" to look for policies added in a "dated" version of CMake. It will fail if a policy is added as of, for example, CMake 2.8.11.20130828. The intent is to prevent such constructs from making it into an "official" release. Three instances actually appeared in the first attempted release candidate for 2.8.12. This test may sometimes yield false positives. After all, it's just using a regular expression to detect this condition, and something in a comment could possibly match it. As of right now, that's not true, but it's easy to imagine such a comment being added. The new test may also not catch all future problems of this sort. However, it will catch problems of this sort for all code that follows the present layout style in Source/cmPolicies.cxx.
* Add cmake_host_system_information commandNils Gladitz2013-06-196-0/+42
| | | | | | Expose the internal system information API to the CMake language. For example, it is useful to see how much memory the system has available to estimate an upper limit of tests that can run in parallel.
* Merge branch 'master' into escape-regex-specials-in-pathRolf Eike Beer2013-06-031-0/+1
|\ | | | | | | | | Resolve conflicts in Tests/CTestTestMemcheck/CMakeLists.txt by combining changes from both sides.
| * Sanitize linker name to parse implicit link line (#14154)Brad King2013-05-171-0/+1
| | | | | | | | | | | | | | | | Teach CMakeParseImplicitLinkInfo to convert the CMAKE_LINKER file name to a regular expression that matches only the original name. Escape special characters like '+' so they are not treated as regex syntax. Extend the ImplicitLinkInfoTest to test handling of a CMAKE_LINKER value with many special characters.
* | Fix test failures caused by regexp-sensitive characters in the build pathsModestas Vainius2013-06-034-28/+41
|/ | | | | | | | | | | | | | | | | | Checkout [1] as an example of the test failures. In that particular cases, the failures is caused by the plus sign in the path being pass unescaped (buildd-cmake_2.8.9-1~bpo60+1-armel-3Lvkef) to the regexp. In addition to failures in the log, the following new tests also fail in 2.8.11: 243 - CTestTestMemcheckUnknown (Failed) 244 - CTestTestMemcheckUnknownQuoted (Failed) 248 - CTestTestMemcheckDummyValgrindFailPre (Failed) 249 - CTestTestMemcheckDummyValgrindFailPost (Failed) 250 - CTestTestMemcheckDummyPurify (Failed) 251 - CTestTestMemcheckDummyBC (Failed) 253 - CMake.List (Failed) [1] https://buildd.debian.org/status/fetch.php?pkg=cmake&arch=armel&ver=2.8.9-1~bpo60%2B1&stamp=1369243896
* Merge topic 'implicit-lib-canonical-path'Brad King2013-02-081-0/+6
|\ | | | | | | | | 10e8b2d Normalize full paths in implicit link library list
| * Normalize full paths in implicit link library listBrad King2013-02-061-0/+6
| | | | | | | | | | | | | | | | | | | | Teach CMakeParseImplicitLinkInfo to convert implicit link library full paths to a canonical form. This makes them more reproducible in case different language compiler front-ends add the same library by different paths e.g. ".../libA.a" and "...//libA.a". Add a case to the CMake.ImplicitLinkInfo test to cover removal of extra slashes from both library and directory paths.
* | ProcessorCount test: require SystemInformation process to workRolf Eike Beer2013-01-241-1/+8
| | | | | | | | | | Currently this silently fails on some systems. Make sure those things get noticed so we can fix that.