diff options
author | Brad King <brad.king@kitware.com> | 2016-01-20 13:45:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-01-20 13:55:23 (GMT) |
commit | 1787269ef3c476ee1176c92c54e5b22f9cb7f3fe (patch) | |
tree | 7d57e297ec9ac6f2a5aa650042b50bfaebd48412 /Tests | |
parent | d8bced813cdd0c3eb7c2e3e150f513da04ded513 (diff) | |
download | CMake-1787269ef3c476ee1176c92c54e5b22f9cb7f3fe.zip CMake-1787269ef3c476ee1176c92c54e5b22f9cb7f3fe.tar.gz CMake-1787269ef3c476ee1176c92c54e5b22f9cb7f3fe.tar.bz2 |
cmake: Fix `-E time` argument passing to child
Since this command was introduced in 2002 it has incorrectly constructed
the child process command line by concatenating arguments separated by
spaces with no quoting. Fix this by passing the command argument vector
directly to RunSingleCommand without an intermediate quoting and
re-parsing step.
Reported-by: Andrey Pokrovskiy <wonder.mice@gmail.com>
Diffstat (limited to 'Tests')
4 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/E_time-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_time-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_time-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_time-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_time-no-arg-stderr.txt new file mode 100644 index 0000000..50d9b03 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_time-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E <command> \[arguments\.\.\.\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/E_time-stdout.txt b/Tests/RunCMake/CommandLine/E_time-stdout.txt new file mode 100644 index 0000000..a51446a --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_time-stdout.txt @@ -0,0 +1,3 @@ +^hello world +Elapsed time: [^ +]*$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 8068973..e3b73ff 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -12,6 +12,9 @@ run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append) run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate) +run_cmake_command(E_time ${CMAKE_COMMAND} -E time ${CMAKE_COMMAND} -E echo "hello world") +run_cmake_command(E_time-no-arg ${CMAKE_COMMAND} -E time) + run_cmake_command(E___run_iwyu-no-iwyu ${CMAKE_COMMAND} -E __run_iwyu -- command-does-not-exist) run_cmake_command(E___run_iwyu-bad-iwyu ${CMAKE_COMMAND} -E __run_iwyu --iwyu=iwyu-does-not-exist -- command-does-not-exist) run_cmake_command(E___run_iwyu-no--- ${CMAKE_COMMAND} -E __run_iwyu --iwyu=iwyu-does-not-exist command-does-not-exist) |