summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-18 14:01:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-18 14:01:21 (GMT)
commita1cb4485805337d4fc995621187d392047dad789 (patch)
treec8ad5409cdcc88d172a8a535eca64c540decfd22 /Tests
parentae5f8684f93483baf875eedf5e545c29c68a0d97 (diff)
parent7083b1949801dcab8b76cd3978261aca7be30c0e (diff)
downloadCMake-a1cb4485805337d4fc995621187d392047dad789.zip
CMake-a1cb4485805337d4fc995621187d392047dad789.tar.gz
CMake-a1cb4485805337d4fc995621187d392047dad789.tar.bz2
Merge topic 'correct_multiple_source_warnings' into release-3.23
7083b19498 cmake: When given multiple source paths use last instead of first Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7001
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/CommandLine/S-S-Sdiffers-stderr.txt9
-rw-r--r--Tests/RunCMake/CommandLine/S-S-Simplicit-stderr.txt9
-rw-r--r--Tests/RunCMake/CommandLine/S-S-differs-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/S-implicit-differs-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/S-implicit-differs2-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/S-implicit-differs3-stderr.txt4
7 files changed, 46 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 5944d2d..17adefd 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -168,6 +168,18 @@ endif()
run_cmake_with_raw_args(S-B-non-path "-S \"${source_dir}\" -B \"${binary_dir}\" \"\"")
run_cmake_with_raw_args(S-B-non-path2 "-S \"${source_dir}\" \"\" -B \"${binary_dir}\"")
+ file(REMOVE_RECURSE "${binary_dir}/other_dir")
+ file(MAKE_DIRECTORY "${binary_dir}/other_dir")
+ file(WRITE "${binary_dir}/other_dir/CMakeLists.txt" [=[ ]=])
+ run_cmake_with_options(S-S-same -S ${source_dir} -S ${source_dir} -B ${binary_dir})
+ run_cmake_with_options(S-S-differs -S ${binary_dir}/other_dir -S ${source_dir} -B ${binary_dir})
+ run_cmake_with_options(S-implicit-same -S ${source_dir} ${source_dir} -B ${binary_dir})
+ run_cmake_with_options(S-implicit-differs -S ${source_dir} ${binary_dir}/other_dir -B ${binary_dir})
+ run_cmake_with_options(S-implicit-differs2 ${binary_dir}/other_dir -S ${source_dir} -B ${binary_dir})
+ run_cmake_with_options(S-implicit-differs3 ${binary_dir}/other_dir ${source_dir} -B ${binary_dir})
+ run_cmake_with_options(S-S-Sdiffers -S ${binary_dir}/other_dir1 -S ${binary_dir}/other_dir2 -S ${source_dir} -B ${binary_dir})
+ run_cmake_with_options(S-S-Simplicit ${binary_dir}/other_dir1 ${binary_dir}/other_dir2 ${source_dir} -B ${binary_dir})
+
# make sure that -B can explicitly construct build directories
file(REMOVE_RECURSE "${binary_dir}")
run_cmake_with_options(B-arg -B ${binary_dir} ${source_dir})
diff --git a/Tests/RunCMake/CommandLine/S-S-Sdiffers-stderr.txt b/Tests/RunCMake/CommandLine/S-S-Sdiffers-stderr.txt
new file mode 100644
index 0000000..43869db
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/S-S-Sdiffers-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Warning:
+ Ignoring extra path from command line:
+
+ .*other_dir1"
+.*
+CMake Warning:
+ Ignoring extra path from command line:
+
+ .*other_dir2"$
diff --git a/Tests/RunCMake/CommandLine/S-S-Simplicit-stderr.txt b/Tests/RunCMake/CommandLine/S-S-Simplicit-stderr.txt
new file mode 100644
index 0000000..43869db
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/S-S-Simplicit-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Warning:
+ Ignoring extra path from command line:
+
+ .*other_dir1"
+.*
+CMake Warning:
+ Ignoring extra path from command line:
+
+ .*other_dir2"$
diff --git a/Tests/RunCMake/CommandLine/S-S-differs-stderr.txt b/Tests/RunCMake/CommandLine/S-S-differs-stderr.txt
new file mode 100644
index 0000000..5714130
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/S-S-differs-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Warning:
+ Ignoring extra path from command line:
+
+ .*ExplicitDirs-build/other_dir.*
diff --git a/Tests/RunCMake/CommandLine/S-implicit-differs-stderr.txt b/Tests/RunCMake/CommandLine/S-implicit-differs-stderr.txt
new file mode 100644
index 0000000..18f0d16
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/S-implicit-differs-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Warning:
+ Ignoring extra path from command line:
+
+ .*other_dir"$
diff --git a/Tests/RunCMake/CommandLine/S-implicit-differs2-stderr.txt b/Tests/RunCMake/CommandLine/S-implicit-differs2-stderr.txt
new file mode 100644
index 0000000..5714130
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/S-implicit-differs2-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Warning:
+ Ignoring extra path from command line:
+
+ .*ExplicitDirs-build/other_dir.*
diff --git a/Tests/RunCMake/CommandLine/S-implicit-differs3-stderr.txt b/Tests/RunCMake/CommandLine/S-implicit-differs3-stderr.txt
new file mode 100644
index 0000000..5714130
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/S-implicit-differs3-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Warning:
+ Ignoring extra path from command line:
+
+ .*ExplicitDirs-build/other_dir.*