Commit Graph

215 Commits

Author SHA1 Message Date
Vasiliy Koyrev
9da542d5c1 string(TIMESTAMP): Add %z and %Z for adding time zone string
Fixes: #24056
2022-10-27 11:13:46 -04:00
Brad King
8d453ee751 Tests: Improve CheckSourceTree test
Re-implement the test using simpler approach.  Enable it only when doing
an out-of-source build with a `.git` source.  Run it last, serially.
Re-use the `git` tool found for version computation.  Print the output
from `git status` without modification.  Rely on `.gitignore` instead
of filtering out paths ourselves.
2022-10-05 12:38:12 -04:00
Robert Maynard
93f2cd5b7c CMakeParseImplicitLinkInfo: Better detection of msvc
Use the compiler id information in addition to checking for `cl.exe`.
2022-09-02 08:04:39 -04:00
m.klimenko
231872ddb0 file(DOWNLOAD): Add options to download a range 2022-02-15 22:08:06 +03:00
Paweł Bylica
1a813273ca Tests: Add more version comparison tests 2021-12-08 12:05:36 -05:00
Alex Turbov
e808cbb1dd Testing: Convert cmake_host_system_information tests into RunCMake 2021-08-02 23:43:47 +03:00
Brad King
1d7fddca8e CMakeParseImplicitLinkInfo: Honor GNU static runtime library flags
With flags like `-static-libstdc++` or `-static-libgfortran`, the GNU
compiler driver adds `-Bstatic ... -Bdynamic` around its language
runtime library.  Convert the libraries in between these to absolute
paths so that mixed-language linking honors the static runtime
libraries.
2021-06-03 08:12:58 -04:00
Orgad Shaneh
ddcd1469e8 MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
2021-04-26 14:27:34 -04:00
Adriaan de Groot
44ad3f0b7f ctest: Support multiple -L and -LE options to mean "AND"
Fixes: #21087
2021-03-28 12:04:05 +11:00
Brad King
f79d991dfd Tests: Convert CMake.ELF to RunCMake.file-RPATH ELF case 2021-02-03 12:26:02 -05:00
william.r.dieter
c0b1f5f30c Tests: Add host to ENV{no_proxy} when DNS lookup failure is expected
DNS lookup of an invalid host name fails with a different error in a proxy
environment than it does in an environment without proxy.  Many tools,
including curl, use the `no_proxy` environment variable to provid a list
of hosts for which proxy should not be used.

To make lookup failure consistent, add invalid host names to the
`no_proxy` environment variable in tests that attempt to look up invalid
host names.  This way the lookup will fail consistently regardless of
whether proxy is generally used or not.

Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-01-29 16:22:15 -05:00
Asit Dhal
38e2299fc8 list(REMOVE_ITEM): Make removal of an empty item a no-op.
Fixes: #21663
2021-01-12 08:27:40 +01:00
Chuck Atkins
72e7c45e98 Tests: Bump CMake minimum required in tests to 2.8.12
Since 3.19, CMake generates a deprecation warning when using a minimum
version less than 2.8.12.  This eliminates those warnings generated
during tests, which are typically hidden from the user and developer but
are being generated nonetheless.
2020-12-23 08:55:45 -05:00
Kyle Edwards
12f6e37eb7 cmListFileCache: Enforce proper nesting of flow control statements
Fixes: #19153
2020-10-22 11:40:48 -04:00
Kyle Edwards
fed7d8f76d file(DOWNLOAD): Make file argument optional 2020-07-27 11:26:50 -04:00
Johnny Jazeix
da99eca1e7 list: add NATURAL sorting on SORT sub-command
Fixes: #20563
2020-04-13 18:26:28 +02:00
Brad King
65a3c68259 Tests: Make CMake.FileDownload invalid host name case more robust
Use a well-defined `.invalid` top-level domain instead of assuming there
is no `.png` top-level domain.  Extend the timeout of this one case to
30 seconds to give DNS lookups a chance to fail instead of timing out.
2020-01-21 09:37:45 -05:00
Johnny Jazeix
c0da651c09 file(DOWNLOAD): Don't fail if given just a filename to write to
Fixes: #17969
2020-01-15 10:03:35 -05:00
Craig Scott
b56d429324 Tests: Fix CMake.FileDownload test failures not reported
Because the PASS_REGULAR_EXPRESSION test property is set,
the exit code of the test is ignored, so we can't just rely on using
message(SEND_ERROR) or the command itself failing. We have to
add an explicit error message for all unexpected status codes
and check for such messages with a FAIL_REGULAR_EXPRESSION.
2020-01-15 10:03:35 -05:00
Brad King
3bc73803b4 Tests: Fix CMake.FileDownload test in presence of proxy
We do not actually need to contact any real http servers.
The one attempt we make is to an intentionally bad domain name.
Unset any proxy configuration that may change behavior.
2020-01-15 10:03:34 -05:00
Brad King
1352585301 Tests: Extend CMake.FileDownload test internal timeouts
On a busy machine running many tests in parallel the `file(DOWNLOAD)`
step can take longer than 2 seconds even to simply copy a file.
Raise the timeout to 4 seconds to reduce spurious failures.
2020-01-15 10:03:19 -05:00
Jiang Yue
f08dcbffec Property: Add INSTALL_REMOVE_ENVIROMENT_RPATH property 2019-07-25 12:30:23 -04:00
Lucy Phipps
b9e6d04558 Reduce size of PNG images
Use FileOptimizer 13.50.2431 (x86) and ZopfliPNG 1.0.2.

Update expected file hashes in tests.
2019-01-25 09:14:51 -05:00
Brad King
beb991110d Remove now-unused code once used on IRIX
We dropped support for IRIX as a host platform long ago.
Remove some leftover code.
2019-01-11 13:50:46 -05:00
Artur Ryt
fe9a16c80f cmMakefile: Fix @CMAKE_CURRENT_LIST_LINE@ for ExpandVariablesInStringNew
Added check for variable name in @@ evaluation and test for
configuring @CMAKE_CURRENT_LIST_LINE@ with new CMP0053

Fixes: #18646
2018-12-12 08:29:14 -05:00
Artur Ryt
dda4755b46 cmMakefile: Fix ConfigureString not passing filename and line
It enables to use CMAKE_CURRENT_LIST_LINE in string(CONFIGURE)
Added tests for it for ${} and @@ notattion for old CMP0053
and ${} for new
2018-12-12 08:29:01 -05:00
Daniel Chabrowski
a08154d493 list: Allow inserting at the end of a list
Fixes: #18069
2018-07-05 13:53:49 -04:00
Israel Blancas
46fa1af514 Tests: Fix CheckSourceTree for in-source non-dashboard builds
For in-source builds we must tolerate non-tracked files in the
source tree.  Previously we only tolerated them for dashboard
builds during automated testing, but we should tolerate them for
local user builds too.

Fixes: #17868
2018-05-03 09:35:45 -04:00
Brad King
eb0498357f Exclude "libgcc_eh" library files from implicit link libraries
Extend the fix in commit v3.9.6~1^2 (Restore exclusion of "gcc_eh" from
implicit link libraries, 2017-11-07) to also exclude `gcc_eh` libraries
referenced by absolute path to the library file.

Issue: #17436
2018-04-16 11:56:23 -04:00
Bernhard M. Wiedemann
e1cd936c62 Tests: Fix TIMESTAMP-UnixTime test under SOURCE_DATE_EPOCH=1
The test was expecting timestamps on day 1 in 1970 to start at 86400 but
they actually started at 0.  This worked without `SOURCE_DATE_EPOCH=1`
because after 1972, leap days compensated the offset.

Fixes: #17762
2018-02-26 10:35:30 -05:00
Brad King
bd68d0c252 Merge topic 'implicit-lib-gcceh'
41aacca7 Restore exclusion of "gcc_eh" from implicit link libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1460
2017-11-08 08:25:16 -05:00
Christian Pfeiffer
41aacca7fb Restore exclusion of "gcc_eh" from implicit link libraries
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
2017-11-08 08:10:52 -05:00
Ben Boeckel
d20485d8d9 gitattributes: prefer eol=lf to crlf=input
The `crlf` attribute is deprecated in Git.
2017-08-23 13:30:00 -04:00
Brad King
fda50a0843 CMakePushCheckState: Fix cmake_push_check_state RESET argument
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
2017-07-12 15:09:16 -04:00
Florian Maushart
e7869e80ce cmake_host_system_information: Add more keywords
Extend the `cmake_host_system_information()` command to add processor
identification keywords.
2017-06-05 13:51:30 -04:00
Christian Pfeiffer
c2c2d36619 ImplicitLinkInfo: Add support for PGI on Windows
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.
2017-05-20 20:02:43 +02:00
Christian Pfeiffer
d59e350985 Do not assume GCC libs are linked by all compilers
Not all compilers link libgcc and libgcc_s causing trouble when linking
C++ code with instance PGI Fortran and C compilers.
2017-05-05 17:26:29 +02:00
Christian Pfeiffer
81841426fc separgs: Migrate tests to RunCMake tests 2017-04-26 20:26:47 +02:00
Brad King
d34daca368 Merge topic 'mac-implicit-link-no-lto-flag'
53f17333 CMakeParseImplicitLinkInfo: Ignore ld -lto_library flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !658
2017-04-04 09:18:39 -04:00
Brad King
53f17333f8 CMakeParseImplicitLinkInfo: Ignore ld -lto_library flag
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
2017-04-03 13:23:31 -04:00
Brad King
c2c2286228 Tests: Fix CMake.GetPrerequisites test config message
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.
2017-04-03 10:45:03 -04:00
Gregor Jasny
0bbd993f61 Make CMAKE_HOST_SYSTEM_NAME available in scripting context 2017-02-19 19:27:34 +01:00
Brad King
14c771530a Tests: Fix file:// URLs given to curl
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.
2017-02-10 13:10:07 -05:00
Michael Maltese
72ed051b12 CMakeDetermineCompilerId: check with and without user-specified flags
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
2017-02-06 13:12:06 -05:00
Bernhard M. Wiedemann
5181f1f86a Tests: make tests pass with SOURCE_DATE_EPOCH set
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.
2017-01-30 09:25:44 -05:00
Brad King
95420cea5e CMakeParseImplicitLinkInfo: Add support for MSVC invoked by CUDA nvcc 2017-01-12 10:39:01 -05:00
Brad King
60939702e1 file: Add support for SHA-3 algorithms 2016-11-10 16:41:45 -05:00
Brad King
92f95aede9 string: Add support for SHA-3 algorithms 2016-11-10 16:40:43 -05:00
Brad King
756169ac99 Tests: Update ModuleNotices test for new notice 2016-09-27 15:18:07 -04:00
Ruslan Baratov
751f7b5255 string(TIMESTAMP ...): add '%a' and '%b' format specifiers
%b: Abbreviated month name (e.g. Oct).
%a: Abbreviated weekday name (e.g. Fri).
2016-09-12 19:07:38 +03:00