summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
Commit message (Collapse)AuthorAgeFilesLines
* Add a way to print the origins of used include directories.Stephen Kelly2013-01-034-0/+82
|
* Keep track of INCLUDE_DIRECTORIES as a vector of structs.Stephen Kelly2013-01-039-13/+31
| | | | | The struct can keep track of where the include came from, which gives us proper backtraces.
* Add policy CMP0019 to skip include/link variable re-expansionBrad King2012-12-078-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | Historically CMake has always expanded ${} variable references in the values given to include_directories(), link_directories(), and link_libraries(). This has been unnecessary since general ${} evaluation syntax was added to the language a LONG time ago, but has remained for compatibility with VERY early CMake versions. For a long time the re-expansion was a lightweight operation because it was only processed once at the directory level and the fast-path of cmMakefile::ExpandVariablesInString was usually taken because values did not have any '$' in them. Then commit d899eb71 (Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES, 2012-02-22) made the operation a bit heavier because the expansion is now needed on a per-target basis. In the future we will support generator expressions in INCLUDE_DIRECTORIES with $<> syntax, so the fast-path in cmMakefile::ExpandVariablesInString will no longer be taken and re-expansion will be very expensive. Add policy CMP0019 to skip the re-expansion altogether in NEW behavior. In OLD behavior perform the expansion but improve the fast-path heuristic to match ${} but not $<>. If the policy is not set then warn if expansion actually does anything. We expect this to be encountered very rarely in practice.
* Genex: Don't segfault on $<FOO,>Stephen Kelly2012-11-272-0/+10
| | | | | | Treat the comma as part of the identifier here. It will later not resolve to a generator expression and the user gets a proper error message.
* Genex: Ensure that $<0:...> has a parameter.Stephen Kelly2012-11-274-0/+14
|
* Add tests for VS_SOLUTION_GLOBAL_SECTIONSPetr Kmoch2012-11-1618-0/+120
| | | | | Add tests for correct appliation of directory properties VS_SOLUTION_GLOBAL_SECTIONS_*
* Merge topic 'deprecate-load_command'Brad King2012-11-135-0/+14
|\ | | | | | | | | d2d4398 load_command: Deprecate and document pending removal
| * load_command: Deprecate and document pending removalBrad King2012-11-075-0/+14
| | | | | | | | | | | | | | | | | | This command works only when building projects using the same architecture as the running CMake binary. Since it was introduced CMake has learned macro() and function() to add commands, and the execute_process() command to launch advanced external computations. Add a RunCMake.load_command test to verify the warning appears.
* | GenEx: Test early determination of AND and ORStephen Kelly2012-10-204-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It should be possible for example to do this: "$<AND:${FOO},$<BOOL:${TGT}>,$<BOOL:$<TARGET_PROPERTY:${TGT},PROP>" such that it works simliarly to the C code: if (foo && tgt && tgt->prop()) { } The example of generator expression code is a little bit contrived as it could be written other ways with the same functionality. Nevertheless, as these cases already work and are intentional, test for them.
* | GenEx: Fix reporting about not-found include directories and libraries.Stephen Kelly2012-10-176-0/+23
| | | | | | | | | | | | This fixes a regression introduced in commit 290e92ad (Move GetIncludeDirectories to cmGeneratorTarget, 2012-09-16) which loops over cmGeneratorTargets before they get created, so the container is empty.
* | GenEx: Validate target and property names.Stephen Kelly2012-10-0925-0/+125
| | | | | | | | They must be non-empty, and match a restrictive regexp.
* | GenEx: Parse comma after colon tokens speciallyStephen Kelly2012-10-095-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise the comma is treated as plain text by ParseContent. $<STREQUAL:,> should be valid and true. $<STREQUAL:,something> should be valid and false. $<STREQUAL:,,> should be non-valid as it is 3 parameters. $<STREQUAL:something,,> should be non-valid as it is 3 parameters. Additionally, this allows reporting the correct error for other expressions. For example $<TARGET_PROPERTY:,> should be invalid because it has an empty target and empty property. It shouldn't attempt to read the property ',' on the 'implicit this' target.
* | GenEx: Report actual target name not found, not "0" each time.Stephen Kelly2012-10-094-0/+15
| |
* | Process generator expressions in the COMPILE_DEFINITIONS target property.Stephen Kelly2012-09-287-0/+36
| |
* | Process generator expressions in the INCLUDE_DIRECTORIES property.Stephen Kelly2012-09-2815-0/+77
| | | | | | | | | | This use of generator expressions, like all others to come which operate on target properties, must initalize the dag checker.
* | cmGeneratorExpression: Re-write for multi-stage evaluationStephen Kelly2012-09-188-7/+136
|/ | | | | | | | The expressions may be parsed and then cached and evaluated multiple times. They are evaluated lazily so that literals such as ',' can be treated as universal parameter separators, and can be processed from results without appearing literally, and without interfering with the parsing/evaluation of the entire expression.
* Add $<CONFIG:...> boolean query generator expressionBrad King2012-08-154-0/+13
| | | | | | | This expression evaluates to '1' or '0' to indicate whether the build configuration for which the expression is evaluated matches tha named configuration. In combination with the "$<0:...>" and "$<1:...>" expressions this allows per-configuration content to be generated.
* Add boolean generator expressionsBrad King2012-08-1512-0/+85
| | | | | | | | | | | | | Add generator expressions that combine and use boolean test results: $<0:...> = empty string (ignores "...") $<1:...> = content of "..." $<AND:?[,?]...> = '1' if all '?' are '1', else '0' $<OR:?[,?]...> = '0' if all '?' are '0', else '1' $<NOT:?> = '0' if '?' is '1', else '1' These will be useful to evaluate (future) boolean query expressions and condition content on the results. Include tests and documentation.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-10/+10
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* include: Ignore empty string as file name (#13388)Brad King2012-07-107-0/+20
| | | | | | | | | Previously CMake silently accepted the empty string and added a bogus dependency on the current directory. Instead warn about the empty file name and ignore it. We cannot make this an error because there may be existing projects that accidentally depend on the old behavior. Add a RunCMake.include test to cover this case.
* Do not crash on SHARED library without language (#13324)Brad King2012-06-207-0/+10
| | | | | | | | | | | | | Since commit e1409ac5 (Support building shared libraries or modules without soname, 2012-04-22) CMake crashes on the code add_library(foo SHARED foo.nolang) because the logic to lookup the language's soname flag was moved from cmTarget::GetLibraryNames to cmMakefile::GetSONameFlag without its check for a NULL language. Restore the check for NULL. Add RunCMake.Languages test to cover language error cases like this one.
* Merge branch 'list-empty-error' into enhance-include_external_msprojectBrad King2012-04-1912-0/+30
|\ | | | | | | Resolve conflict in Tests/RunCMake/CMakeLists.txt by adding both tests.
| * list: Handle errors on empty lists more gracefully (#13138)Brad King2012-04-1712-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | Since commit ed1ea24c (Fix INSERT to allow inserting to empty list, 2006-05-15) the list command allows insertion into an empty list at index 0. Fix rejection of insertion at non-zero (negative) indices to present an error message instead of crashing. While at it, fix the error message of the GET and REMOVE_AT operations when the list is empty to not present a bogus allowed range. Add a "RunCMake.list" test to cover failure cases on empty lists.
* | include_external_msproject: Test TYPE, GUID, PLATFORM options (#13120)Brad King2012-04-1911-0/+138
| | | | | | | | | | | | | | | | | | Add "RunCMake.include_external_msproject" test to use the TYPE, GUID, and PLATFORM options to include_external_msproject. Since projects with custom types and platforms cannot be loaded without special VS plugins validate the results by directly parsing the generated solution (.sln). Co-Author: Leonid Yurchenko <nocturne@qarea.com>
* | Teach RunCMake tests to allow custom checksBrad King2012-04-192-9/+19
|/ | | | | | Look for a <SubTest>-check.cmake script and load it to check side effects of the sub test. Provide it with the test source and build tree paths in variables. Check for a failure message in a result variable.
* Merge topic 'ImprovedCOMPONENTSSupportInFindPackage2'David Cole2012-03-214-0/+11
|\ | | | | | | | | | | | | | | | | | | 6d100f9 find_package: Test rejection of required+optional components d81d83c add macro check_required_components() to configure_package_config_file() b15c0b4 FPHSA(): add HANDLE_COMPONENTS option 34108cd find_package: add documentation for OPTIONAL_COMPONENTS cdabde8 FPHSA(): add missing "]" to documentation f2e0a18 find_package: add OPTIONAL_COMPONENTS keyword
| * find_package: Test rejection of required+optional componentsBrad King2012-03-194-0/+11
| |
* | Merge topic 'object-library'David Cole2012-03-2053-0/+165
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 93d5509 Merge branch 'ninja-object-library' into object-library 821037c Merge branch 'xcode-object-library' into object-library eb24c99 Merge branch 'object-library' into xcode-object-library 63d1be8 Xcode: Honor $<TARGET_OBJECTS:...> source expressions 020ba38 Merge branch 'object-library' into xcode-object-library e8ea615 Build object library targets in Xcode 8045e17 Pre-compute object file names before Xcode generation 247a132 Allow txt files as ExtraSources in object library targets b063599 Add a default source group for object files. be01f3b Xcode: Re-factor some existing methods into "FromPath" variants 2693dbe Merge branch 'object-library' into ninja-object-library 51997cb Ninja: Honor $<TARGET_OBJECTS:...> source expressions 23ec258 Merge branch 'object-library' into ninja-object-library 61124de Build object library targets in Ninja f5b06cd Pre-compute object file names before Ninja generation a2514f1 Simplify cmNinjaTargetGenerator using cmGeneratorTarget ...
| * Test OBJECT library language propagationBrad King2012-03-163-0/+17
| | | | | | | | | | | | Teach the RunCMake.ObjectLibrary test to verify that languages used in an OBJECT library are propagated to targets that use it so that the languages can be included in link analysis.
| * Test OBJECT library failure casesBrad King2012-03-1651-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add "RunCMake.ObjectLibrary" test to verify that unsupported use cases are rejected with errors: * An OBJECT library may not reference another object library * An OBJECT library may not be referenced in target_link_libraries * An OBJECT library may not contain non-compiling sources * An OBJECT library may not have pre/post build/link commands * An OBJECT library may not be installed, exported, or imported Also verify that invalid $<TARGET_OBJECTS:...> expressions are diagnosed.
* | find_package: additional test for checking the error messageAlex Neundorf2012-03-134-0/+13
|/ | | | | | | | This patch adds a test which checks the error message, which is produced in the case that a Config file has set Foo_FOUND to FALSE by itself. Alex
* Use generalized RunCMake test infrastrucure for build_command testBrad King2012-03-1210-0/+82
| | | | | | | The CMakeCommands.build_command test performs output/error checking so move it over to RunCMake to re-use the generalized infrastrucure. This is the only test left using Tests/CMakeCommands/CMakeLists.txt so remove it.
* Use generalized RunCMake test infrastrucure for find_package testBrad King2012-03-1231-0/+276
|
* Add stronger infrastructure for CMake-only testsBrad King2012-03-122-0/+110
The CMakeOnly directory added by commit 9a20abf0 (Add infrastructure for CMake-only tests, 2012-01-11) was sufficient only for tests that always run CMake to successfully configure a project. Later commit eeaaffcb (find_package: Test error and warning messages in failure cases, 2012-02-28) added a sample test that covers failure cases. Generalize the above to create new "RunCMake" test infrastructure that can run CMake multiple times for a single project with different variations and check for expected result/stdout/stderr. Allow for both successful and failing CMake project configuration cases. This will be useful to test error messages and failure behavior.