summaryrefslogtreecommitdiffstats
path: root/Tests/Module
Commit message (Collapse)AuthorAgeFilesLines
* ExternalData: Add support for custom algorithm-to-URL mappingBrad King2015-02-256-0/+16
| | | | | | | | | Allow URL templates to contain a %(algo:<key>) placeholder that is replaced by mapping the canonical hash algorithm name through a map defined by the <key>. Extend the Module.ExternalData test to cover the behavior. Extend the RunCMake.ExternalData test to cover error cases.
* Features: Fix C90 feature detection.Stephen Kelly2015-02-043-0/+80
| | | | | | | | | | | | | | | This bug caused c_function_prototypes to not be recorded at configure time when compiling with -std=gnu99 or similar. In the case of feature recording, that was not a problem, because the logic in CMakeDetermineCompileFeatures.cmake currently assumes that a feature present for an earlier standard is present for a later standard. However, the detection strings are also used in WriteCompilerDetectionHeader, so the feature macro has been defined to '0' when using a later language dialect. Fix that by not checking the existence of the __STDC_VERSION__ macro at all when detecting C90 features.
* Features: Record for MSVC 2010-2015Robert Maynard2015-01-301-2/+13
| | | | | | | Also, in WCDH add MSVC Compatibility for cxx_align{of,as}. Co-Author: Stephen Kelly <steveire@gmail.com> Co-Author: Brad King <brad.king@kitware.com>
* WCDH: Test that no C compiler features are defined for CXX compiler.Stephen Kelly2015-01-192-0/+8
| | | | | This amends commit 54156d72 (WCDH: Generate per-language files in multi-file mode., 2015-01-17).
* WCDH: Fix the C_STANDARD property in the tests.Stephen Kelly2015-01-191-1/+1
| | | | | | | | | | The CXX_STANDARD property validates the values allowed for it, and '90' is not a valid value for it. However, the validation is only done for languages enabled for the target, and as C_undefined has no CXX files, that language is not enabled for it. This amends commit v3.1.0-rc3~23^2 (WCDH: Make the header -Wundef safe for the C language., 2014-11-24).
* Merge topic 'GNU-4.4-compile-features'Brad King2015-01-191-6/+8
|\ | | | | | | | | | | | | | | | | | | | | 004e1540 Features: Record for GNU 4.4. 2a5ca650 Features: Wrap failure-test in UNIX condition. 1ae2c6b2 Features: Blacklist cxx_constexpr test for GNU 4.5. c66e3317 Features: Use a more-common feature in cycle-test. c43a6dc5 Features: Update comment in test to match the code. 78259135 Features: Test presence of cxx_auto_type with genex. 7b9fc88b Features: Remove outdated comment.
| * Features: Wrap failure-test in UNIX condition.Stephen Kelly2015-01-181-6/+8
| | | | | | | | | | The use of GNU on non-UNIX for 'compile features' is not tested and is not well defined.
* | Features: Record for SolarisStudio 12.4.Stephen Kelly2015-01-171-3/+4
|/ | | | It has similar C++11 capabilities compared to GCC 4.8.
* ExternalData: Add support for custom download scriptsBrad King2015-01-154-0/+13
| | | | | | | | 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.
* Revert topic 'feature_record_msvc'Brad King2015-01-141-14/+2
| | | | | | | | | | | 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.
* Features: Enable writing of MSVC compiler feature header.Robert Maynard2015-01-111-2/+14
| | | | | | | | | | | | | | | | | 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.
* Features: Quote all compiler names when comparing with COMPILER_IDRobert Maynard2015-01-111-7/+7
| | | | | In preparation of adding MSVC support we need to quote all compiler names, as MSVC is also a CMake variable.
* Features: Record for AppleClang 5.1Stephen Kelly2014-12-221-4/+6
| | | | | Apple's Clang 5.1 already supports most of the C and C++ features CMake enumerates.
* Merge topic 'WCDH-multi-file'Brad King2014-11-264-23/+58
|\ | | | | | | | | 4cf5179c WCDH: Make it possible to generate multiple files.
| * WCDH: Make it possible to generate multiple files.Stephen Kelly2014-11-244-23/+58
| | | | | | | | | | | | Extend the write_compiler_detection_header interface to allow specifying a location for supplementary files, and getting the list of resulting files as a variable.
* | WCDH: Make the header -Wundef safe for the C language.Stephen Kelly2014-11-252-0/+14
|/ | | | | | | | | The __STDC_VERSION__ macro may be defined or not depending on the implementation dialect of C. Test that it is defined before testing its value. The CXX tests do not need such a change because they define __cplusplus in all dialects.
* Features: Add compiler version support to WriteCompilerDetectionHeader.Stephen Kelly2014-06-092-0/+19
|
* Features: Record for Clang 3.4Stephen Kelly2014-05-201-2/+3
| | | | Clang 3.4 supports all features currently known to CMake.
* Features: Extend concept to C language.Stephen Kelly2014-05-141-2/+3
| | | | | | | | | | | Add properties and variables corresponding to CXX equivalents. Add features for c_function_prototypes (C90), c_restrict (C99), c_variadic_macros (C99) and c_static_assert (C11). This feature set can be extended later. Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader to conditionally represent the c_restrict feature.
* Add the WriteCompilerDetectionHeader module.Stephen Kelly2014-05-142-0/+98
| | | | | | | | Provide a function to write a portable header to detect compiler features. Generate a preprocessor #error for unknown compilers and compiler versions whose features are not yet recorded. This error condition might be relaxed in the future, but for now it is useful for verification of expectations.
* Merge topic 'hp-cpp98-tests'Brad King2014-05-081-0/+9
|\ | | | | | | | | b0f277db HP aCC: record compiler flag for Ansi C++98 support for version 3.80 onwards
| * HP aCC: record compiler flag for Ansi C++98 support for version 3.80 onwardsRolf Eike Beer2014-04-251-0/+9
| | | | | | | | | | | | Old versions of aCC need a special compiler flag to get full C++98 template support as e.g. CMake itself or the Complex and ComplexOneConfig tests need. The same versions need a special flag to get a proper C++ library, too.
* | ExternalData: Warn on missing file instead of failingBrad King2014-04-172-0/+24
|/ | | | | | | | | | | | When the primary source tree path named by a DATA{} reference does not exist, produce an AUTHOR_WARNING instead of a FATAL_ERROR. This is useful when writing a new DATA{} reference to a test reference output that has not been created yet. This way the developer can run the test, manually verify the output, and then copy it into place to provide the reference and eliminate the warning. If the named source tree path is expected to be a file but exists as a directory, we still need to produce a FATAL_ERROR.
* find_dependency: Extend the tests for use of EXACT macro parameter.Stephen Kelly2014-03-108-1/+62
|
* Add test for find_dependency macro.Stephen Kelly2014-02-268-0/+79
|
* Merge some GenerateExportHeader subtests.Stephen Kelly2013-12-1515-143/+28
|
* Speed up the GenerateExportHeader unit test (#14453).Stephen Kelly2013-12-1517-183/+567
| | | | | | | | Instead of running many small tests with many cmake projects, simply compare the generated export header against a reference. Remove the helper macros and the try_compiles which are duplicates of the library build tests.
* ExternalData: Allow local stores without any URL templatesBrad King2013-11-135-0/+44
| | | | | | | | | Allow ExternalData_URL_TEMPLATES to be empty if a value for ExternalData_OBJECT_STORES is provided. Assume in this use case that the object stores will already contain all needed objects. Extend the Module.ExternalData test to cover this case (all objects in stores). Extend the RunCMake.ExternalData test to cover the non-failure message case when stores are provided without URL templates.
* CheckTypeSize: Add unit testsDaniele E. Domenichelli2013-10-214-1/+223
|
* Merge topic 'VISIBILITY_PRESET-property'Brad King2013-06-055-0/+48
|\ | | | | | | | | | | cd1fa53 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property. 0e9f4bc Introduce target property <LANG>_VISIBILITY_PRESET
| * Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.Stephen Kelly2013-06-021-0/+4
| | | | | | | | | | | | | | This corresponds to the g++ and clang++ option -fvisibility-inlines-hidden on linux. On Windows with MinGW, this corresponds to -fno-keep-inline-dllexport. That option is not supported by clang currently.
| * Introduce target property <LANG>_VISIBILITY_PRESETStephen Kelly2013-06-025-0/+44
| | | | | | | | | | | | This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target property is used as the operand to the -fvisibility= compile option with GNU compilers and clang.
* | Merge topic 'geh-cleanup-identifiers'Brad King2013-05-245-0/+44
|\ \ | | | | | | | | | | | | 7e24997 GenerateExportHeader: Generate only C identifiers as defines
| * | GenerateExportHeader: Generate only C identifiers as definesStephen Kelly2013-05-245-0/+44
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The variables in this module are used to configure a header file with defines whose name depends on the name of the target. As valid names of targets may be invalid for use as defines, convert the names of the defines used to C identifiers first. This is already done in C++ code for the DEFINE_SYMBOL property. This is not as simple as ensuring that the BASE_NAME is a C identifier, because most of the define names are configurable, and because use of a BASE_NAME which is not a C identifier, such as 4square can become a C identifier by specifying a prefix in the generate_export_header macro.
* | Merge topic 'geh-add-missing-test'Brad King2013-05-241-0/+1
|\ \ | | | | | | | | | | | | 74f24b2 Tests/Module/GenerateExportHeader: Test exported free-function
| * | Tests/Module/GenerateExportHeader: Test exported free-functionStephen Kelly2013-05-241-0/+1
| |/
* | GenerateExportHeader: Add newlines to separate the compiler output.Stephen Kelly2013-05-231-2/+2
|/ | | | Make the error logs more readable.
* ExternalData: Preserve escaped semicolons during argument expansionBrad King2013-03-122-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CMake language implicitly flattens lists so a ";" in a list element must be escaped with a backslash. List expansion removes backslashes escaping semicolons to leave raw semicolons in the values. Teach ExternalData_Add_Test and ExternalData_Expand_Arguments to re-escape semicolons found in list elements so the resulting argument lists work as if constructed directly by the set() command. For example: ExternalData_Add_Test(Data NAME test1 COMMAND ... "a\\;b") ExternalData_Expand_Arguments(Data args2 "c\\;d") add_test(NAME test2 COMMAND ... ${args2}) should be equivalent to set(args1 "a\\;b") add_test(NAME test1 COMMAND ... ${args1}) set(args2 "c\\;d") add_test(NAME test2 COMMAND ... ${args2}) which is equivalent to add_test(NAME test1 COMMAND ... "a;b") add_test(NAME test2 COMMAND ... "c;d") Note that it is not possible to make ExternalData_Add_Test act exactly like add_test when quoted arguments contain semicolons because the CMake language flattens lists when constructing function ARGN values. This re-escape approach at least allows test arguments to have semicolons. While at it, teach ExternalData APIs to not transform "DATA{...;...}" arguments because the contained semicolons are non-sensical. Suggested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
* ExternalData: Test content link with a space in its nameBrad King2013-02-223-0/+12
| | | | | | Extend the Module.ExternalData test to cover a DATA{} reference whose name contains a space. Skip the case when the native build tool does not support spaces.
* Fix Module.ExternalData test on CygwinBrad King2013-02-041-1/+5
| | | | | In ExternalData_URL_TEMPLATES add a leading slash to the path after file:// only if the path does not already start with one.
* ExternalData: Collapse ../ components in DATA{} pathsBrad King2013-01-303-3/+8
| | | | | Relative path components need to be normalized out even if they appear in the middle of a caller-supplied string.
* ExternalData: Add support for SHA 1 and 2 hash algorithmsBrad King2013-01-3013-0/+18
| | | | | Update the Module.ExternalData and RunCMake.ExternalData tests to cover some of them.
* ExternalData: Allow DATA{} syntax to reference directoriesBrad King2013-01-305-0/+10
| | | | | | | Use a trailing slash to reference a directory. Require that a list of associated files be specified to select from within the directory. One may simply use DATA{Dir/,REGEX:.*} to reference all files but get a directory passed on the command line.
* ExternalData: Allow ()-groups in series match regexBrad King2013-01-301-1/+1
| | | | | | | Refactor use of the ExternalData_SERIES_MATCH value to avoid assuming that it has no ()-groups that interfere with group indexing. Extend the Module.ExternalData test to cover this case.
* ExternalData: Add tests covering interfaces and errorsBrad King2013-01-3060-0/+184
| | | | | | | | Add a Module.ExternalData test to verify data retrieval and test argument DATA{} references. Add a RunCMake.ExternalData test to verify error handling and automatic transformation of a raw data to a content link and staged object.
* CheckTypeSize: add a test for size of struct membersRolf Eike Beer2012-08-144-2/+68
|
* CheckCXXCompilerFlag test: make it a CMakeOnly testRolf Eike Beer2012-01-301-74/+0
|
* GenerateExportHeader test: add newlines before end of fileRolf Eike Beer2012-01-175-5/+5
|
* Build each library only once instead of once for each test.Stephen Kelly2011-10-094-5/+58
|
* Remove unused define.Stephen Kelly2011-10-091-8/+0
|