summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/testStringAlgorithms.cxx18
-rw-r--r--Tests/RunCMake/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/P_P_in_arbitrary_args-stdout.txt10
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake2
6 files changed, 31 insertions, 7 deletions
diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx
index f73e62a..cb5f886 100644
--- a/Tests/CMakeLib/testStringAlgorithms.cxx
+++ b/Tests/CMakeLib/testStringAlgorithms.cxx
@@ -149,13 +149,23 @@ int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
{
std::string val;
std::string expect;
- val.reserve(120 * cmStrLen("cmStrCat move"));
+ val.reserve(50 * cmStrLen("cmStrCat move ") + 1);
auto data = val.data();
+ auto capacity = val.capacity();
+ bool moved = true;
for (int i = 0; i < 100; i++) {
- val = cmStrCat(std::move(val), "cmStrCat move");
- expect += "cmStrCat move";
+ if (i % 2 == 0) {
+ val = cmStrCat(std::move(val), "move ");
+ expect += "move ";
+ } else {
+ val = cmStrCat("cmStrCat ", std::move(val));
+ expect = "cmStrCat " + std::move(expect);
+ }
+ if (val.data() != data || val.capacity() != capacity) {
+ moved = false;
+ }
}
- assert_ok((val.data() == data), "cmStrCat move");
+ assert_ok(moved, "cmStrCat move");
assert_string(val, expect, "cmStrCat move");
}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 0fe4919..78615d9 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -760,8 +760,11 @@ add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DMSYS
set_property(TEST RunCMake.install APPEND
PROPERTY LABELS "ISPC")
+if(DEFINED CMake_COMPILER_FORCES_NEW_DTAGS)
+ list(APPEND file-GET_RUNTIME_DEPENDENCIES_ARGS
+ -DCMake_COMPILER_FORCES_NEW_DTAGS=${CMake_COMPILER_FORCES_NEW_DTAGS})
+endif()
add_RunCMake_test(file-GET_RUNTIME_DEPENDENCIES
- -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMake_INSTALL_NAME_TOOL_BUG=${CMake_INSTALL_NAME_TOOL_BUG}
)
diff --git a/Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi.cmake b/Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi.cmake
index 91f3995..88d50db 100644
--- a/Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi.cmake
+++ b/Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi.cmake
@@ -1,6 +1,6 @@
function (check_for_bmi prefix destination name)
set(found 0)
- foreach (ext IN ITEMS gcm ifc)
+ foreach (ext IN ITEMS gcm ifc pcm)
if (EXISTS "${prefix}/${destination}/${name}.${ext}")
set(found 1)
break ()
diff --git a/Tests/RunCMake/CommandLine/P_P_in_arbitrary_args-stdout.txt b/Tests/RunCMake/CommandLine/P_P_in_arbitrary_args-stdout.txt
new file mode 100644
index 0000000..95304ab
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_P_in_arbitrary_args-stdout.txt
@@ -0,0 +1,10 @@
+^-- CMAKE_ARGC='6'
+-- CMAKE_ARGV1='-P'
+-- CMAKE_ARGV2='[^']*/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake'
+-- CMAKE_ARGV3='--'
+-- CMAKE_ARGV4='-P'
+-- CMAKE_ARGV5='[^']*/Tests/RunCMake/CommandLine/non_existing.cmake'
+-- CMAKE_ARGV6=''
+-- CMAKE_ARGV7=''
+-- CMAKE_ARGV8=''
+-- CMAKE_ARGV9=''$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 9f342bb..480ad09 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -55,6 +55,7 @@ run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
run_cmake_command(P_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_args.cmake" relative/path "${RunCMake_SOURCE_DIR}")
run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO -S -B --fresh --version)
+run_cmake_command(P_P_in_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -P "${RunCMake_SOURCE_DIR}/non_existing.cmake")
run_cmake_command(P_fresh ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_fresh.cmake" --fresh)
run_cmake_command(build-no-dir
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
index 75bfc07..43b406b 100644
--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
@@ -59,7 +59,7 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(ENV{LDFLAGS} "${new_ldflags}")
endif()
- if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL")
+ if(NOT CMake_COMPILER_FORCES_NEW_DTAGS)
run_install_test(linux)
run_install_test(linux-parent-rpath-propagation)
run_install_test(file-filter)