Commit Graph

3373 Commits

Author SHA1 Message Date
Brad King 5803ae3e88 Merge topic 'add-FindJsonCpp'
0aebeb9c FindJsonCpp: Add module to find JsonCpp package
2015-01-19 09:43:12 -05:00
Brad King 0aebeb9c84 FindJsonCpp: Add module to find JsonCpp package 2015-01-19 09:34:03 -05:00
Brad King 8b7db43bc6 Merge topic 'GNU-4.6-compile-features'
770ba876 Help: Add notes for topic 'GNU-4.6-compile-features'
b15c008f Features: Record for GNU 4.6.
f13a2eb1 Features: Adjust the RunCMake test to use more-common features.
1f19ac4d Features: Adjust cxx_variadic_templates unit test for GNU < 4.7.
0798d1e5 Features: Extend the generalized_initializers test for GNU < 4.7.
938bd94e Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU < 4.7 compatibility.
462c630b Features: Don't test __cplusplus value for CXX98 on GNU.
222ec86f Features: Test an old value of __STDC_VERSION__ for GNU < 4.7 compatibility.
6e909035 Features: Record C/CXX dialect flags for GNU 4.6.
bfc995cc Features: Remove wrong content from else() condition.
1532b921 Features: Make cxx_noexcept available from GNU 4.6.
1f4649e6 Features: Update the default_dialect test for old GNU-like compilers.
a60027a6 Features: Ensure appropriate return value from feature test macros.
2015-01-16 11:07:14 -05:00
Brad King ba7227a0af Merge topic 'extend-COMPILE_FEATURES-test'
06ff5254 Features: Extend the tests for the COMPILE_FEATURES genex.
2015-01-16 11:07:12 -05:00
Brad King c15a2fdd2e Merge topic 'tests-RunCMake-report-command'
6c121924 Tests: Teach RunCMake to report command-line on failure
2015-01-16 09:43:56 -05:00
Stephen Kelly b15c008fac Features: Record for GNU 4.6.
Adjust the CompileFeatures genex_test for the expectation of the
OVERRIDE_CONTROL feature group.
2015-01-16 00:11:01 +01:00
Stephen Kelly f13a2eb118 Features: Adjust the RunCMake test to use more-common features. 2015-01-16 00:11:01 +01:00
Stephen Kelly 1f19ac4da5 Features: Adjust cxx_variadic_templates unit test for GNU < 4.7.
The unit test for this fails with GNU 4.6:

 Building CXX object CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o
   CompileFeatures/cxx_variadic_templates.cpp: In static member function ‘static int Interface<I, Is>::accumulate()’:
   CompileFeatures/cxx_variadic_templates.cpp:18:31: sorry, unimplemented: cannot expand ‘Is ...’ into a fixed-length argument list
 CMakeFiles/test_cxx_variadic_templates.dir/build.make:54: recipe for target 'CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o' failed

The workaround is to use a specialization:

 http://stackoverflow.com/questions/1989552
 http://stackoverflow.com/questions/11297376
2015-01-15 22:13:22 +01:00
Stephen Kelly 0798d1e5b0 Features: Extend the generalized_initializers test for GNU < 4.7.
That compiler requires a different initializer_list constructor, so
update the test to match.
2015-01-15 22:13:22 +01:00
Stephen Kelly 1f4649e62f Features: Update the default_dialect test for old GNU-like compilers.
Prior to GNU 4.7, GNU defined __cplusplus incorrectly, and defined
__GXX_EXPERIMENTAL_CXX0X__ in C++11 mode.
2015-01-15 22:13:22 +01:00
Stephen Kelly 06ff525492 Features: Extend the tests for the COMPILE_FEATURES genex. 2015-01-15 21:51:18 +01:00
Brad King 6c121924ad Tests: Teach RunCMake to report command-line on failure
When a test sets RunCMake_TEST_COMMAND, report the command line
on failure to make it easier to run by hand for debugging.
2015-01-15 14:46:58 -05:00
Brad King 0fe4d8bb3b ExternalData: Add support for custom download scripts
Add support for a special URL template to map the fetch operation
to a project-specified .cmake script insead of using file(DOWNLOAD).

Extend the Module.ExternalData test to cover the behavior.
Extend the RunCMake.ExternalData test to cover error cases.
2015-01-15 10:48:09 -05:00
Brad King b4263abdea Merge topic 'Xcode-clang-compile-features'
dcd72a74 Help: Add notes for topic 'Xcode-clang-compile-features'
3ad893b5 Features: Record for historical Xcode clang versions.
98965fb1 Features: Record dialect flags for AppleClang 4.0+.
2015-01-15 09:54:08 -05:00
Brad King 44612e7407 Merge topic 'fix-LOCATION-with-TARGET_OBJECTS'
23f3798c cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338)
2015-01-15 09:53:59 -05:00
Brad King 101a62aacb Merge topic 'revert-feature_record_msvc'
4ce110bb Tests: Revert workaround for COMPILE_FEATURES genex bug
0b7e7e27 Revert topic 'feature_record_msvc'
2015-01-15 09:53:47 -05:00
Brad King 4ce110bbba Tests: Revert workaround for COMPILE_FEATURES genex bug
The second hunk of commit 07d1f6fc (Features: Properly evaluate if the
compiler supports cxx_final, 2014-12-31) was a workaround for a bug in
the COMPILE_FEATURES generator expression that caused it never to return
0.  Revert the workaround so we can fix the bug instead.
2015-01-14 13:41:45 -05:00
Brad King 0b7e7e277c Revert topic 'feature_record_msvc'
Revert commits:

 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.

This topic was merged to master prematurely, so remove it.
2015-01-14 13:35:58 -05:00
Stephen Kelly 23f3798c7b cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338)
Commit v3.1.0-rc1~297^2~5 (cmTarget: Drop 'head' argument from
GetSourceFiles, 2014-07-10) exposed a dormant bug in source file computation,
causing the test case to regress.  After that commit, the source file
computation and caching finds an existing container of source files.  Prior to
that patch, the GetSourceFiles method was called with either a null pointer
for the head cmTarget, or it was called with the this pointer.  The
processSources method is eventually called, which normalizes the difference
between the null pointer and the this pointer for the head target.  However,
the cache key depends on the actual pre-normalized pointer.  The change in
that commit caused the entry to be found in the cache where it was not before,
which resulted in incorrect behavior.

Prior to that commit, the test case also fails if the GetSourceFiles overload
taking a vector<cmSourceFile*> is changed to normalize the head target at
the beginning of the method:

  cmTarget const* head = head_ ? head_ : this;

Such a construct was correctly used in other locations where similar caching
was in place, before being removed in commit v3.1.0-rc1~310^2~25 (cmTarget:
Remove 'head' argument from GetLinkInformation, 2014-06-12), but is not
neccessary anymore.

Commit v3.1.0-rc1~674^2~2 (cmTarget: Cache the cmSourceFiles in
GetSourceFiles., 2014-04-05) introduced the caching, but fails the test case
for an unrelated reason.  That unrelated error was introduced in
commit v3.1.0-rc1~688^2~5 (cmTarget: Allow any generator expression in
SOURCES property., 2014-03-18) and fixed in
commit v3.1.0-rc1~561^2~1 (cmTarget: Fix listing of source files at
configure-time., 2014-04-13).

All commits which fail the test case in the testable way do so when such a
cached version of the source files is found and returned at generate
time.  In the test case, the cached content is populated at configure-time
through the use of the deprecated LOCATION property with CMP0026 OLD.  The
cached content is an empty container for the bar target in the test case,
because its source file 'foo.cpp.o' is not known until generate-time.  That
means that no source files are available to compute the link language and
the reported error is issued.

The actual problem is that the SourceFilesMap should be cleared after
configure time by cmTarget::ClearLinkMaps.  Clear it there now.
2015-01-13 09:36:20 +01:00
Brad King b4f62b875b Merge topic 'fix-autouic-regression'
9a673737 QtAutoUic: Add a test for the regression in the parent commit.
7c585699 QtAutoUic: Restore source file AUTOUIC_OPTIONS settings
2015-01-12 08:57:52 -05:00
Brad King b5a467262b Merge topic 'drop-ancient-workarounds'
0f7bdd61 Remove VS 6 special case.
5e92c826 Remove some obsolete stuff.
15e42bb2 cmStandardIncludes: Remove obsolete cmOStringStream.
931e055d Port all cmOStringStream to std::ostringstream.
f194a009 Remove unused cmIStringStream class.
3ec1bb15 cmStandardIncludes: Remove std namespace hack.
bb3bce70 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack.
28fa4923 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler.
837a8a63 cmStandardIncludes: Drop Comeau-related workaround.
4030ddfd Remove Borland-related undef.
17d6a6fd cmStandardIncludes: Remove comment about Borland.
26fb5011 Drop SGI as a CMake host compiler.
2015-01-12 08:57:39 -05:00
Stephen Kelly 9a67373716 QtAutoUic: Add a test for the regression in the parent commit. 2015-01-12 01:41:27 +01:00
Brad King 68f9e67242 Merge topic 'tests-encoding'
9a8ab866 Encoding:  Modify tests to work using non-ascii paths.
2015-01-11 12:00:30 -05:00
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
Brad King ca5fe169aa Merge branch 'fix-empty-target-property-queries' into release 2015-01-11 11:50:14 -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
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Stephen Kelly 3ad893b5c2 Features: Record for historical Xcode clang versions. 2015-01-11 16:52:27 +01: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
Clinton Stimpson 9a8ab86645 Encoding: Modify tests to work using non-ascii paths.
For complex*, CustomCommand and OutDir tests, non-ascii paths
are avoided in test code by using relative paths, and setting
the working when running the test.  This also avoids the
need to internationalize the test code.

For RunCMake.GeneratorExpression, use a UTF-8 encoding in
file(STRINGS) to retrieve the compiled absolute path correctly.
2015-01-08 20:56:51 -07: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