CMake/Tests/RunCMake/ExternalData
Brad King 1823ab4d76 ExternalData: Preserve escaped semicolons during argument expansion
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>
2013-03-12 16:33:19 -04:00
..
Directory1
Directory2
Directory3
Directory4 ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
SubDirectory1 ExternalData: Collapse ../ components in DATA{} paths 2013-01-30 14:55:12 -05:00
BadHashAlgo1-result.txt
BadHashAlgo1-stderr.txt
BadHashAlgo1.cmake ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
BadHashAlgo1.txt
BadOption1-result.txt
BadOption1-stderr.txt
BadOption1.cmake ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
BadOption2-result.txt
BadOption2-stderr.txt
BadOption2.cmake
BadSeries1-result.txt
BadSeries1-stderr.txt
BadSeries1.cmake
BadSeries2-result.txt
BadSeries2-stderr.txt
BadSeries2.cmake ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
BadSeries3-result.txt
BadSeries3-stderr.txt
BadSeries3.cmake
CMakeLists.txt
Data.txt.md5
Directory1-result.txt
Directory1-stderr.txt ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
Directory1.cmake
Directory2-result.txt
Directory2-stderr.txt ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
Directory2.cmake
Directory2.md5
Directory3-result.txt
Directory3-stderr.txt
Directory3.cmake
Directory4-result.txt ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
Directory4-stderr.txt ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
Directory4.cmake ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
Directory5-result.txt ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
Directory5-stderr.txt ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
Directory5.cmake ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
LinkContentMD5-stdout.txt
LinkContentMD5.cmake
LinkContentSHA1-stdout.txt ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
LinkContentSHA1.cmake ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
MissingData-result.txt
MissingData-stderr.txt
MissingData.cmake
NoLinkInSource-stderr.txt
NoLinkInSource-stdout.txt
NoLinkInSource.cmake
NoURLTemplates-result.txt
NoURLTemplates-stderr.txt ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
NoURLTemplates.cmake
NormalData1-stdout.txt ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
NormalData1.cmake
NormalData2-stdout.txt
NormalData2.cmake ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
NormalData3-stdout.txt ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
NormalData3.cmake
NormalDataSub1-stdout.txt ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
NormalDataSub1.cmake
NotUnderRoot-result.txt ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
NotUnderRoot-stderr.txt ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
NotUnderRoot.cmake ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
RunCMakeTest.cmake ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Semicolon1-stdout.txt ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Semicolon1.cmake ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Semicolon2-stdout.txt ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Semicolon2.cmake ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Semicolon3-stdout.txt ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Semicolon3.cmake ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
SubDirectory1-stdout.txt ExternalData: Collapse ../ components in DATA{} paths 2013-01-30 14:55:12 -05:00
SubDirectory1.cmake