I have¹ a CTest like:

execute_process(...)
set(expected "
...text...
...text...
")
string(REGEX MATCH ${expected} match ${out})

So, basically, I'm checking that the process outputs a certain set of lines, and taking advantage of multi-line strings in CTest script for convenience and readability.

This works great... *IF* the script file has UNIX line endings. I'm wondering if that is expected? It seems that CTest must be processing the script in binary mode in order for the string to contain '\r' characters...

(I don't need the obvious work-around². I'm asking if this is expected and e.g. if I should file a bug report...)

I haven't tested exhaustively but this may not affect all versions of CMake. (Noticed on 2.8.11.1.)

https://github.com/commontk/AppLauncher/blob/master/Testing/CMake/AppLauncher-Settings-TestEnvironment.cmake)

https://github.com/mwoehlke-kitware/AppLauncher/tree/test-multi-line-string-fixes)

--
Matthew

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to