Commit Graph

3346 Commits

Author SHA1 Message Date
Brad King 775fb2e0b0 Merge topic 'feature_record_msvc'
2d738ce3 Help: Add notes for topic 'feature_record_msvc'
f73718c9 Features: Enable writing of MSVC compiler feature header.
64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015.
225c0ef8 Features: Record for MSVC 2010-2013.
2015-01-11 12:00:24 -05:00
Brad King 1c0d6a7cb5 Merge topic 'refactor-CompileFeatures-test'
a15675ef Features: Quote all compiler names when comparing with COMPILER_ID
07d1f6fc Features: Properly evaluate if the compiler supports cxx_final.
6296192d Features: Add a comment explaining part of test.
c13656e7 Features: Test nullptr as a side-effect activation of static_assert.
3e34e833 Features: Test feature propagation with more-common features.
b3e86f4e Features: Test an expectation of whether OVERRIDE_CONTROL is expected
2015-01-11 12:00:22 -05:00
Brad King cb5fc7b993 Merge topic 'fix-empty-target-property-queries'
c6d03a10 tests: add tests for querying properties
76ff92e0 set_tests_properties: fix documentation
28214862 get_test_property: clarify the documentation
34a99094 get_target_property: discern empty from undefined properties (#15333)
2015-01-11 12:00:20 -05:00
Ben Boeckel c6d03a1072 tests: add tests for querying properties 2015-01-11 11:45:44 -05:00
Robert Maynard f73718c9b8 Features: Enable writing of MSVC compiler feature header.
Notes:
VS2015 and above are the only MSVC versions to support cxx_final, so remove
usages from the tests, and instead only test for cxx_override.

VS2012 and above to conform to cxx_decltype_incomplete_return_types
proposal, but without support for auto return types the dcl.type.simple
example in the proposal doesn't compile.

VS2013 and above to conform to the updated cxx_contextual_conversions proposal,
but VS2010 and above pass the test.

Compilers such as MSVC have no explicit flags to enable C++11 mode,
it just is always on. So only run the link tests with compilers that require
a flag to specify the language version.
2015-01-11 11:32:36 -05:00
Robert Maynard a15675efc3 Features: Quote all compiler names when comparing with COMPILER_ID
In preparation of adding MSVC support we need to quote all compiler names,
as MSVC is also a CMake variable.
2015-01-11 16:47:58 +01:00
Robert Maynard 07d1f6fca1 Features: Properly evaluate if the compiler supports cxx_final.
Previously we expanded HAVE_FINAL to determine what the copied_file number
would be, but when we don't have cxx_final than HAVE_FINAL is not defined.
What we really want is to use expected_result.
2015-01-11 16:47:58 +01:00
Stephen Kelly 6296192def Features: Add a comment explaining part of test. 2015-01-03 15:18:39 +01:00
Stephen Kelly c13656e717 Features: Test nullptr as a side-effect activation of static_assert.
Because not all compilers under test support the existing 'activation
features', add another test to ensure that compilers which support
both static_assert and nullptr behave as expected in this test.
2015-01-03 15:14:52 +01:00
Stephen Kelly 3e34e8331a Features: Test feature propagation with more-common features.
The purpose of the feature listing in these tests is to make other
features from the same feature set (eg "C++11 features") available.

The compilers under test until now have supported these 'activation
features', but MSVC does not.  Use the cxx_static_assert feature
instead to activate the feature set.
2015-01-03 15:11:04 +01:00
Stephen Kelly b3e86f4e97 Features: Test an expectation of whether OVERRIDE_CONTROL is expected
The tests below test the presence of both cxx_final and cxx_override,
only one of which is supported by MSVC.  The test is in part intended
to verify that the COMPILE_FEATURES genex supports multiple arguments
and allows users to define names for groups of features (Clang already
calls cxx_final and cxx_override 'override control' as a group).  Keep
the test, and allow the expectation to be set as appropriate.
2015-01-03 15:09:58 +01:00
Stephen Kelly 73ae888506 RunCMake: Expect empty output by default.
Expect tests to specify stderr content if it is present.

Fix the CMP0019 test, which has only been testing the WARN status
until now.  Specify in the CommandLine and FPHSA tests that content
is at least one character.

Set policies in the Language and CheckModules tests, which have empty
test output, modulo unrelated policies on some platforms.
2014-12-31 16:34:34 +01:00
Brad King 661622f011 Merge topic 'ninja-fix-subdir-objlib-languages'
07fc7b75 Tests: Test using objects from a language enabled in a subdirectory (#15325)
fdbfcfdf Ninja: Generate rules only for languages compiled in a target (#15325)
2014-12-24 06:38:24 -05:00
Brad King 396a008ff0 Merge topic 'AppleClang-5.1-features'
bb83cdaa Help: Add notes for topic 'AppleClang-5.1-features'
bd6b42c1 Features: Record for AppleClang 5.1
b341799e Tests: Fix RunCMake.CompileFeatures test NonValidTarget2 case
2014-12-23 08:53:52 -05:00
Brad King 400af305ef Merge topic 'add-FindGSL'
1b28e3b2 FindGSL: Add module to find the GNU Scientific Library
2014-12-23 08:53:45 -05:00
Brad King 07fc7b75ef Tests: Test using objects from a language enabled in a subdirectory (#15325)
Add a test case that enables CXX in the top level and C in a subdirectory.
Create an executable in the top level that uses C objects compiled in the
subdirectory.  Strictly speaking this is not defined behavior for all
language combinations, but happens to work in this case.  Test this
behavior since projects might try to use it.
2014-12-22 20:13:40 -05:00
Stephen Kelly bd6b42c186 Features: Record for AppleClang 5.1
Apple's Clang 5.1 already supports most of the C and C++ features CMake
enumerates.
2014-12-22 10:44:41 -05:00
Brad King b341799e53 Tests: Fix RunCMake.CompileFeatures test NonValidTarget2 case
Mark the generated source file with the GENERATED property explicitly
since it is not marked automatically as the output of any custom
command.  Mark both the 0 and 1 variants so it works no matter the
outcome of the generator expression.
2014-12-22 10:36:35 -05:00
Brad King ccd5822a83 Merge topic 'osx-cfbundle-tweaks'
b189c599 Tests: Run CFBundleTest only with valid configuration
3a605693 Xcode: Call IsCFBundleOnApple to decide if bundle is being built
207b7af0 cmTarget: Use GetCFBundleDirectory within GetFullNameInternal
2014-12-19 08:26:57 -05:00
Brad King 1ac8523c3b Merge topic 'install-EXPORT-absolute-prefix'
dd089e08 install: Allow absolute EXPORT destination with relative targets (#15258)
2014-12-19 08:26:55 -05:00
Brad King b189c5994d Tests: Run CFBundleTest only with valid configuration
The verification script needs to know the configuration tested.
2014-12-19 08:24:04 -05:00
Brad King 45b1e31451 Merge topic 'vs-nsight-tegra-min-api'
eeaa25e5 Add 'ANDROID_API_MIN' target property to set Android Target MIN API
2014-12-18 10:16:40 -05:00
Brad King 0549694718 Merge topic 'test-memcheck-with-RunCMake'
7ca6bdf0 Tests: Move CTestTestMemcheck tools into Tests/CMakeLib
1651dc96 Tests: Move CTestTestMemcheck cases into a RunCMake.CTestMemcheck test
2014-12-18 10:16:31 -05:00
Brad King 7ca6bdf035 Tests: Move CTestTestMemcheck tools into Tests/CMakeLib
The dummy memcheck tools we build for the RunCMake.CTestMemcheck tests
require CMakeLib, so put them in a Tests/CMakeLib/PseudoMemcheck
directory.
2014-12-18 10:12:16 -05:00
Brad King 1651dc9668 Tests: Move CTestTestMemcheck cases into a RunCMake.CTestMemcheck test
The CTestTestMemcheck test cases all try to check the ctest output with
a regular expression.  They fail intermittently due to ordering of the
portions of the output that come from stdout and stderr being mixed.
Convert all the test cases to use the RunCMake infrastructure to match
stdout and stderr separately.
2014-12-18 10:12:15 -05:00
Brad King 70ffd71db1 Merge topic 'test-RunCMake-updates'
29533380 Tests: Allow RunCMake expected result code to be a regex
a85ee8b8 Tests: Simplify RunCMake test extra argument passing
da7155f5 Tests: Allow RunCMake tests to pass generator expressions
2014-12-17 14:44:22 -05:00
Dmitry Polyanitsa eeaa25e521 Add 'ANDROID_API_MIN' target property to set Android Target MIN API
Also add a 'CMAKE_ANDROID_API_MIN' variable to set the property
default.  Teach the VS generator to write the MIN API value into
Nsight Tegra project files.
2014-12-17 11:17:28 -05:00
Kelly Thompson 1b28e3b28b FindGSL: Add module to find the GNU Scientific Library 2014-12-17 10:59:48 -05:00
Brad King 2a3e263173 Tests: Fix CheckSourceTree test for newer Git
The output of 'git status' no longer starts each line in '#'.
Match that optionally.
2014-12-16 14:51:06 -05:00
Brad King 29533380ea Tests: Allow RunCMake expected result code to be a regex
This will allow the '-result.txt' files to specify a regex matching
different results on different platforms.
2014-12-16 13:34:34 -05:00
Brad King a85ee8b8cf Tests: Simplify RunCMake test extra argument passing
Allow add_RunCMake_test calls to pass non-optional arguments
immediately.
2014-12-15 16:46:49 -05:00
Brad King da7155f5bc Tests: Allow RunCMake tests to pass generator expressions 2014-12-15 16:46:49 -05:00
Brad King dd089e08b5 install: Allow absolute EXPORT destination with relative targets (#15258)
When install(EXPORT) is given an absolute destination we cannot compute
the install prefix relative to the installed export file location.
Previously we disallowed installation of targets in such exports with a
relative destination, but did not enforce this for target property
values besides the location of the main target file.  This could lead to
broken installations when the EXPORT is installed to an absolute path
but usage requirements are specified relative to the install prefix.

Since an EXPORT installed to an absolute destination cannot be relocated
we can just hard-code the value of CMAKE_INSTALL_PREFIX as the base for
relative paths.  This will allow absolute install(EXPORT) destinations
to work with relative destinations for targets and usage requirements.

Extend the ExportImport test with a case covering this behavior.
2014-12-15 11:45:49 -05:00
Brad King f53a3340bb Tests: Fix OS X version check to use component-wise test
Otherwise 10.10 may be considered to be less than 10.4 and the
tests for CPack will not run.

Reported-by: Sean McBride <sean@rogue-research.com>
2014-12-12 15:11:37 -05:00
Brad King ce331bab92 find_library: Fix repeat call after changing directory content (#15293)
We use cmGlobalGenerator::GetDirectoryContent to avoid repeating
directory listings.  However, GetDirectoryContent loads content from
disk at most once.  This breaks find_library calls that occur when disk
content has changed since preceding find_library calls.

Teach cmGlobalGenerator::GetDirectoryContent to save the directory
modification time when content is loaded and re-load content if it
changes.

Create a RunCMake.find_library test with a case covering this.
2014-12-08 15:35:50 -05:00
Brad King e72987dc11 Merge topic 'custom-command-multiple-outputs'
6c67b816 Makefile: Workaround Borland Make bug with multiple outputs
65ea5eb7 Tests: Cover rebuild with multiple custom command outputs (#15116)
644b4688 Makefile: Fix rebuild with multiple custom command outputs (#15116)
8a4c6d2d Xcode: Fix rebuild with multiple custom command outputs (#15116)
2014-12-08 09:07:18 -05:00
Brad King 413ce02895 Merge topic 'ExternalProject_TEST_EXCLUDE_FROM_MAIN'
636f0c1d ExternalProject: Add TEST_EXCLUDE_FROM_MAIN option
2014-12-08 09:07:10 -05:00
Brad King 90070a65d2 Merge topic 'try_compile-link-flags'
88eb5824 try_compile: Pass linker flags into test project (#14066)
a4f9b6f0 CMakeDetermineCompilerABI: Use normal linker flags in ABI project
2014-12-08 09:07:04 -05:00
Brad King 65ea5eb721 Tests: Cover rebuild with multiple custom command outputs (#15116)
Extend the BuildDepends test with a case covering multiple custom
command outputs with the second one consumed by another rule.  With the
old "multiple output pair" infrastructure used in the Makefile and Xcode
generators this did not work.  Now that it is fixed, test the case
explicitly.
2014-12-05 09:56:26 -05:00
Daniele E. Domenichelli 636f0c1d4f ExternalProject: Add TEST_EXCLUDE_FROM_MAIN option
If this option is enabled, the test step is created with the
EXCLUDE_FROM_MAIN option, and if TEST_BEFORE_INSTALL is enabled, the
install step does not depend on the test step.

This means that the test step is never executed, unless the test target
is explicitly created by calling ExternalProject_Add_StepTarget, or by
passing it with the STEP_TARGETS option, or with the EP_STEP_TARGETS
directory property.
2014-12-05 10:24:16 +01:00
Brad King c7bd275393 Merge topic 'cached-regex-clear-fixed'
ceecd790 cmMakefile: store the number of last matches in a CMake var
7878d061 test: add a test for clearing regex results
2014-12-04 10:23:26 -05:00
Brad King ba98442610 Merge topic 'vs-phone-store-deployment-location'
352f246f VS: Add source file property to specify Windows App deployment location
2014-12-04 09:10:05 -05:00
Brad King 88eb5824da try_compile: Pass linker flags into test project (#14066)
Copy CMAKE_EXE_LINKER_FLAGS into the test project generated by
try_compile, just like we already copy CMAKE_<LANG>_FLAGS.

Add CMake Policy CMP0056 to activate this behavior in a compatible way,
but do not warn by default when the policy is not set since it will
affect all try_compile calls.

Extend the RunCMake.try_compile test with a case covering this behavior
for each policy setting.
2014-12-03 15:30:22 -05:00
Ben Boeckel 7878d06189 test: add a test for clearing regex results 2014-12-03 11:06:44 -05:00
Brad King d90e288b7b Merge topic 'file-LOCK-command'
93017828 Help: Add notes for topic 'file-LOCK-command'
e6db4c5a file: Add LOCK subcommand to do file and directory locking
05d6531c cmSystemTools: Add StringToInt helper
2014-12-03 10:02:07 -05:00
Brad King d91feda413 Merge topic 'icase-source-file-prop'
b7d760ae test: test source file properties with case-insensitivity
2014-12-03 10:02:05 -05:00
Brad King b9eac05fb6 Merge topic 'vs-hlsl-settings'
2a224b4c VS: Add source file properties to set the hlsl shader entry point and model
2014-12-03 10:01:49 -05:00
Ruslan Baratov e6db4c5a4e file: Add LOCK subcommand to do file and directory locking
Provide options to fail without blocking or to block up to a timeout.
Provide options to specify the scope containing the lock so it can be
released automatically at the end of a function, file, or process.

Extend the RunCMake.file test with cases covering the file(LOCK) command
usage and error cases.
2014-12-03 09:47:44 -05:00
Brad King 1c104c019a Merge branch 'vs-phone-store-deployment-location' into release 2014-12-03 09:32:42 -05:00
Brad King 7c28e7c172 Merge branch 'vs-hlsl-settings' into release 2014-12-03 09:32:38 -05:00