diff options
author | Michael Scott <michael.scott250@gmail.com> | 2015-11-29 12:39:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-12-01 14:40:43 (GMT) |
commit | 07388f83b69739116c8364e9443f10158fcdc912 (patch) | |
tree | ecd6ab97971a063dabd853908754874d5f3baa0b /Tests/RunCMake | |
parent | 246b0bfbfda9a8f3091fc34fc92816aebaf60ae9 (diff) | |
download | CMake-07388f83b69739116c8364e9443f10158fcdc912.zip CMake-07388f83b69739116c8364e9443f10158fcdc912.tar.gz CMake-07388f83b69739116c8364e9443f10158fcdc912.tar.bz2 |
Refactor the -W options parser to be generic.
Refactor the -Wdev and -Wno-dev options parser to use a generic -W
parser that follows the GCC pattern, excluding support for
-Werror=TYPE and -Wno-error=TYPE formats for now.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 13 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/W_bad-arg1-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/W_bad-arg2-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt | 2 |
5 files changed, 18 insertions, 1 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 8eaaa08..d4f399c 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -129,13 +129,24 @@ set(RunCMake_TEST_OPTIONS -Wno-dev) run_cmake(Wno-dev) unset(RunCMake_TEST_OPTIONS) -set(RunCMake_TEST_OPTIONS -Wno-dev -Wdev) +set(RunCMake_TEST_OPTIONS -Wdev) run_cmake(Wdev) unset(RunCMake_TEST_OPTIONS) # Dev warnings should be on by default run_cmake(Wdev) +# Conflicting -W options should honor the last value +set(RunCMake_TEST_OPTIONS -Wno-dev -Wdev) +run_cmake(Wdev) +unset(RunCMake_TEST_OPTIONS) +set(RunCMake_TEST_OPTIONS -Wdev -Wno-dev) +run_cmake(Wno-dev) +unset(RunCMake_TEST_OPTIONS) + +run_cmake_command(W_bad-arg1 ${CMAKE_COMMAND} -W) +run_cmake_command(W_bad-arg2 ${CMAKE_COMMAND} -Wno-) + set(RunCMake_TEST_OPTIONS --debug-output) run_cmake(debug-output) unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt b/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt new file mode 100644 index 0000000..0c0f613 --- /dev/null +++ b/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: -W must be followed with \[no-\]<name>. +CMake Error: Problem processing arguments. Aborting. diff --git a/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt b/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt new file mode 100644 index 0000000..cc643df --- /dev/null +++ b/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: No warning name provided. +CMake Error: Problem processing arguments. Aborting. |