summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-12-02 14:25:19 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-12-02 14:25:26 (GMT)
commitdee36398d2f869d3fb5370b1289381905a35ac62 (patch)
treefeb488af42aca9829b7e92d195258caff0fd76f8 /Tests/RunCMake
parentc30b65305e159418845f0d98deeb32ae18e00c1a (diff)
parent1b6c5333a0b4a56eaf8b010084e18a40e473c2e3 (diff)
downloadCMake-dee36398d2f869d3fb5370b1289381905a35ac62.zip
CMake-dee36398d2f869d3fb5370b1289381905a35ac62.tar.gz
CMake-dee36398d2f869d3fb5370b1289381905a35ac62.tar.bz2
Merge topic 'error_out_on_unknown_argument'
1b6c5333a0 cmake: Error out on unknown arguments starting with `-`. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5553
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg1-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg2-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
5 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/InvalidArg1-result.txt b/Tests/RunCMake/CommandLine/InvalidArg1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt b/Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt
new file mode 100644
index 0000000..6b825bb
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Unknown argument -invalid
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CommandLine/InvalidArg2-result.txt b/Tests/RunCMake/CommandLine/InvalidArg2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt b/Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt
new file mode 100644
index 0000000..eb1488c
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Unknown argument --invalid
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index bb40c52..51754fc 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.1)
include(RunCMake)
run_cmake_command(NoArgs ${CMAKE_COMMAND})
+run_cmake_command(InvalidArg1 ${CMAKE_COMMAND} -invalid)
+run_cmake_command(InvalidArg2 ${CMAKE_COMMAND} --invalid)
run_cmake_command(Wizard ${CMAKE_COMMAND} -i)
run_cmake_command(C-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -C)
run_cmake_command(C-no-file ${CMAKE_COMMAND} -B DummyBuildDir -C nosuchcachefile.txt)