summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-14 12:25:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-01-14 12:25:46 (GMT)
commit1f411b0cfaad12c87da02ffc2b20bb791b1f9024 (patch)
tree484d61c9a18f2ce2484262c572f17db27d056c92 /Tests/RunCMake/CommandLine
parent6a23e16ec289ca737b7a4c1020e6b0c71c749672 (diff)
parent27eb7c5bdb5bb8deefe1772675dc4819592bf036 (diff)
downloadCMake-1f411b0cfaad12c87da02ffc2b20bb791b1f9024.zip
CMake-1f411b0cfaad12c87da02ffc2b20bb791b1f9024.tar.gz
CMake-1f411b0cfaad12c87da02ffc2b20bb791b1f9024.tar.bz2
Merge topic 'cmake-option-parsing'
27eb7c5bdb cmake: Ensure source and binary dirs are set a1adbc7243 cmake: Stop processing if -P option lacks file name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2799
Diffstat (limited to 'Tests/RunCMake/CommandLine')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake29
-rw-r--r--Tests/RunCMake/CommandLine/no-S-B-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/no-S-B-stderr.txt1
3 files changed, 17 insertions, 14 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 4cd34de..0e04ad1 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -4,17 +4,17 @@ include(RunCMake)
run_cmake_command(NoArgs ${CMAKE_COMMAND})
run_cmake_command(Wizard ${CMAKE_COMMAND} -i)
-run_cmake_command(C-no-arg ${CMAKE_COMMAND} -C)
-run_cmake_command(C-no-file ${CMAKE_COMMAND} -C nosuchcachefile.txt)
-run_cmake_command(Cno-file ${CMAKE_COMMAND} -Cnosuchcachefile.txt)
+run_cmake_command(C-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -C)
+run_cmake_command(C-no-file ${CMAKE_COMMAND} -B DummyBuildDir -C nosuchcachefile.txt)
+run_cmake_command(Cno-file ${CMAKE_COMMAND} -B DummyBuildDir -Cnosuchcachefile.txt)
run_cmake_command(cache-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeCache.txt)
run_cmake_command(lists-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeLists.txt)
-run_cmake_command(D-no-arg ${CMAKE_COMMAND} -D)
-run_cmake_command(D-no-src ${CMAKE_COMMAND} -D VAR=VALUE)
-run_cmake_command(Dno-src ${CMAKE_COMMAND} -DVAR=VALUE)
-run_cmake_command(U-no-arg ${CMAKE_COMMAND} -U)
-run_cmake_command(U-no-src ${CMAKE_COMMAND} -U VAR)
-run_cmake_command(Uno-src ${CMAKE_COMMAND} -UVAR)
+run_cmake_command(D-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -D)
+run_cmake_command(D-no-src ${CMAKE_COMMAND} -B DummyBuildDir -D VAR=VALUE)
+run_cmake_command(Dno-src ${CMAKE_COMMAND} -B DummyBuildDir -DVAR=VALUE)
+run_cmake_command(U-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -U)
+run_cmake_command(U-no-src ${CMAKE_COMMAND} -B DummyBuildDir -U VAR)
+run_cmake_command(Uno-src ${CMAKE_COMMAND} -B DummyBuildDir -UVAR)
run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E)
run_cmake_command(E_capabilities ${CMAKE_COMMAND} -E capabilities)
run_cmake_command(E_capabilities-arg ${CMAKE_COMMAND} -E capabilities --extra-arg)
@@ -34,8 +34,8 @@ run_cmake_command(E___run_co_compile-bad-iwyu ${CMAKE_COMMAND} -E __run_co_compi
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)
+run_cmake_command(G_no-arg ${CMAKE_COMMAND} -B DummyBuildDir -G)
+run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator)
run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
@@ -61,6 +61,7 @@ function(run_ExplicitDirs)
file(REMOVE_RECURSE "${binary_dir}")
file(MAKE_DIRECTORY "${binary_dir}")
+ run_cmake_command(no-S-B ${CMAKE_COMMAND} -DFOO=BAR)
run_cmake_command(S-arg ${CMAKE_COMMAND} -S ${source_dir} ${binary_dir})
run_cmake_command(S-arg-reverse-order ${CMAKE_COMMAND} ${binary_dir} -S${source_dir} )
run_cmake_command(S-no-arg ${CMAKE_COMMAND} -S )
@@ -330,9 +331,9 @@ 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-)
-run_cmake_command(W_bad-arg3 ${CMAKE_COMMAND} -Werror=)
+run_cmake_command(W_bad-arg1 ${CMAKE_COMMAND} -B DummyBuildDir -W)
+run_cmake_command(W_bad-arg2 ${CMAKE_COMMAND} -B DummyBuildDir -Wno-)
+run_cmake_command(W_bad-arg3 ${CMAKE_COMMAND} -B DummyBuildDir -Werror=)
set(RunCMake_TEST_OPTIONS --debug-output)
run_cmake(debug-output)
diff --git a/Tests/RunCMake/CommandLine/no-S-B-result.txt b/Tests/RunCMake/CommandLine/no-S-B-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/no-S-B-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/no-S-B-stderr.txt b/Tests/RunCMake/CommandLine/no-S-B-stderr.txt
new file mode 100644
index 0000000..7a94307
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/no-S-B-stderr.txt
@@ -0,0 +1 @@
+CMake Error: No source or binary directory provided