diff options
Diffstat (limited to 'Tests/CustomCommand')
-rw-r--r-- | Tests/CustomCommand/CMakeLists.txt | 34 | ||||
-rw-r--r-- | Tests/CustomCommand/check_command_line.c.in | 3 |
2 files changed, 35 insertions, 2 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 3af8540..f50de52 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -176,6 +176,17 @@ SET(CHECK_ARGS double\"quote "\\;semi-colons\\;" "semi\\;colon" + `back-ticks` + back`tick + "(parens)" + "(lparen" + "rparen)" + $dollar-signs$ + dollar$sign + &ersands& + amper&sand + \@two-ats\@ + one@at "c:/posix/path/with space" "c:\\windows\\path\\with space" "'single quotes with space'" @@ -184,6 +195,17 @@ SET(CHECK_ARGS "double\"quote with space" "\\;semi-colons with space\\;" "semi\\;colon with space" + "`back-ticks` with space" + "back`tick with space" + "(parens) with space" + "(lparen with space" + "rparen) with space" + "$dollar-signs$ with space" + "dollar$sign with space" + "&ersands& with space" + "amper&sand with space" + "\@two-ats\@ with space" + "one@at with space" ) FOREACH(arg ${CHECK_ARGS}) SET(ARG "${arg}") @@ -199,8 +221,18 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in @ONLY IMMEDIATE) ADD_EXECUTABLE(check_command_line ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c) -ADD_CUSTOM_TARGET(do_check_command_line #ALL +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check + COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line + ${CHECK_ARGS} + VERBATIM + COMMENT "Checking custom command line escapes" + ) +ADD_CUSTOM_TARGET(do_check_command_line ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check + COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes" COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line ${CHECK_ARGS} + VERBATIM ) ADD_DEPENDENCIES(do_check_command_line check_command_line) diff --git a/Tests/CustomCommand/check_command_line.c.in b/Tests/CustomCommand/check_command_line.c.in index a4dbe22..71d5278 100644 --- a/Tests/CustomCommand/check_command_line.c.in +++ b/Tests/CustomCommand/check_command_line.c.in @@ -20,7 +20,7 @@ int main(int argc, const char* argv[]) } else { - printf("[%s]\n", *a); + /*printf("[%s]\n", *a);*/ } } if(*a || *e) @@ -28,5 +28,6 @@ int main(int argc, const char* argv[]) fprintf(stderr, "Number of arguments does not match expected.\n"); return 1; } + printf("Command line escapes work!\n"); return 0; } |