diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2017-08-28 22:25:13 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2017-09-13 21:44:49 (GMT) |
commit | 3bbe95f58a8fb83e56ca9023ef01b9e70b391b05 (patch) | |
tree | 786b5d6a10a78bff00f6daee00271bdfac3e570f /Tests/RunCMake/CommandLine | |
parent | 3ea87bce69d1b6120b227fed3838f1bc9ab45db1 (diff) | |
download | CMake-3bbe95f58a8fb83e56ca9023ef01b9e70b391b05.zip CMake-3bbe95f58a8fb83e56ca9023ef01b9e70b391b05.tar.gz CMake-3bbe95f58a8fb83e56ca9023ef01b9e70b391b05.tar.bz2 |
Clean up iwyu code to not be one big if statement.
This commit changes the internal -E__run_iwyu to be -E__run_co_compile. This
is used for co-compile commands. These are tools that want to mirror the
compiler. For each compiler invocation the tool will be invoked first. This
started as a way to implement include what you use (iwyu), but has expanded
to include cpplint, cppcheck and others. Likely there will be more in the
future as well. This commit implements each one in its own function and
provides a way to add additional ones in the future with less work.
Diffstat (limited to 'Tests/RunCMake/CommandLine')
12 files changed, 11 insertions, 7 deletions
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-result.txt +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-result.txt diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-stderr.txt index 338f7c4..338f7c4 100644 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-stderr.txt +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no----result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-result.txt +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no----result.txt diff --git a/Tests/RunCMake/CommandLine/E___run_co_compile-no----stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no----stderr.txt new file mode 100644 index 0000000..f0597d2 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no----stderr.txt @@ -0,0 +1 @@ +^__run_co_compile given unknown argument: command-does-not-exist$ diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no----result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-no----result.txt +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-result.txt diff --git a/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-stderr.txt new file mode 100644 index 0000000..bba846e --- /dev/null +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-stderr.txt @@ -0,0 +1 @@ +^__run_co_compile missing compile command after --$ diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-result.txt +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-result.txt diff --git a/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-stderr.txt new file mode 100644 index 0000000..ffa1da8 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-stderr.txt @@ -0,0 +1,5 @@ +^__run_co_compile missing command to run. Looking for one of the following: +.*--cppcheck= +.*--cpplint= +.*--iwyu= +.*--tidy= diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no----stderr.txt b/Tests/RunCMake/CommandLine/E___run_iwyu-no----stderr.txt deleted file mode 100644 index c251adf..0000000 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-no----stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^__run_iwyu given unknown argument: command-does-not-exist$ diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-stderr.txt b/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-stderr.txt deleted file mode 100644 index 1998abb..0000000 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^__run_iwyu missing compile command after --$ diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-stderr.txt b/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-stderr.txt deleted file mode 100644 index 9db95f8..0000000 --- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^__run_iwyu missing --cpplint=, --iwyu=, --lwyu=, --cppcheck= and/or --tidy=$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 6efcc12..55eac5e 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -21,10 +21,10 @@ 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) -run_cmake_command(E___run_iwyu-no-cc ${CMAKE_COMMAND} -E __run_iwyu --iwyu=iwyu-does-not-exist --) +run_cmake_command(E___run_co_compile-no-iwyu ${CMAKE_COMMAND} -E __run_co_compile -- command-does-not-exist) +run_cmake_command(E___run_co_compile-bad-iwyu ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist -- command-does-not-exist) +run_cmake_command(E___run_co_compile-no--- ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist command-does-not-exist) +run_cmake_command(E___run_co_compile-no-cc ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist --) run_cmake_command(G_no-arg ${CMAKE_COMMAND} -G) run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -G NoSuchGenerator) |