CMake/Tests/Module/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
..
Data2 ExternalData: Collapse ../ components in DATA{} paths 2013-01-30 14:55:12 -05:00
Data3 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
Directory ExternalData: Allow DATA{} syntax to reference directories 2013-01-30 10:05:07 -05:00
MD5 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SHA1 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SHA224 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SHA256 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
CMakeLists.txt ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Data Space.dat.md5 ExternalData: Test content link with a space in its name 2013-02-22 08:25:06 -05:00
Data.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
Data1Check.cmake ExternalData: Preserve escaped semicolons during argument expansion 2013-03-12 16:33:19 -04:00
Data2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
Data2b.dat.md5 ExternalData: Collapse ../ components in DATA{} paths 2013-01-30 14:55:12 -05:00
MetaA.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
MetaB.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
MetaC.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
MetaTop.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
PairedA.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
PairedB.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesA.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesA1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesA2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesA3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesAn1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesAn2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesAn3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesB.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesB_1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesB_2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesB_3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesBn_1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesBn_2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesBn_3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesC.1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesC.2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesC.3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesC.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesCn.1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesCn.2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesCn.3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesD-1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesD-2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesD-3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesD.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesDn-1.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesDn-2.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesDn-3.dat.md5 ExternalData: Add tests covering interfaces and errors 2013-01-30 10:04:54 -05:00
SeriesMixed.1.dat.md5 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SeriesMixed.2.dat.sha1 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SeriesMixed.3.dat.sha224 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00
SeriesMixed.4.dat.sha256 ExternalData: Add support for SHA 1 and 2 hash algorithms 2013-01-30 10:05:07 -05:00