summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalData
Commit message (Collapse)AuthorAgeFilesLines
* ExternalData: Add option to recursively match under directoriesBrad King2015-03-2710-0/+33
| | | | | | Extend the ``DATA{Dir/,...}`` syntax with a new ``RECURSE:`` option to enable recursive matching of associated files. This will allow an entire directory tree of data to be referenced at once.
* ExternalData: Add support for custom algorithm-to-URL mappingBrad King2015-02-257-0/+32
| | | | | | | | | 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.
* ExternalData: Add support for custom download scriptsBrad King2015-01-1513-0/+61
| | | | | | | | 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.
* ExternalData: Warn on missing file instead of failingBrad King2014-04-1711-10/+43
| | | | | | | | | | | | 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.
* ExternalData: Allow local stores without any URL templatesBrad King2013-11-133-1/+5
| | | | | | | | | 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.
* Cygwin: Avoid legacy warnings in RunCMake.* testsBrad King2013-08-131-1/+1
| | | | | | Set the minimum required version of CMake high enough to avoid the warning for CMAKE_LEGACY_CYGWIN_WIN32. The warning appears on stderr and breaks the expected output matching.
* ExternalData: Do not re-stage staged object filesBrad King2013-05-243-0/+43
| | | | | | | | | | | | | The ExternalData_LINK_CONTENT option tells ExternalData to convert real data files it finds into content links and to "stage" the original content in a ".ExternalData_<algo>_<hash>" file. However, after a data object has been staged it is possible that a user-provided pattern in the "REGEX:" option will later match the staged object file. We must not process staged object files even when a user pattern matches them. Fix the implementation to not match a staged object file as a normal data file for conversion. Extend the RunCMake.ExternalData test to cover this case.
* ExternalData: Preserve escaped semicolons during argument expansionBrad King2013-03-127-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Collapse ../ components in DATA{} pathsBrad King2013-01-302-2/+13
| | | | | 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-303-0/+26
| | | | | Update the Module.ExternalData and RunCMake.ExternalData tests to cover some of them.
* ExternalData: Allow DATA{} syntax to reference directoriesBrad King2013-01-309-2/+38
| | | | | | | 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: Add tests covering interfaces and errorsBrad King2013-01-3061-0/+357
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.