summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/testStringAlgorithms.cxx58
-rw-r--r--Tests/CMakeLib/testSystemTools.cxx16
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt2
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt16
-rw-r--r--Tests/RunCMake/FindBoost/CMakePackage-stdout.txt2
-rw-r--r--Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt2
-rw-r--r--Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt2
-rw-r--r--Tests/RunCMake/FindBoost/MissingTarget-stdout.txt2
8 files changed, 75 insertions, 25 deletions
diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx
index 55d2a8f..a92a910 100644
--- a/Tests/CMakeLib/testStringAlgorithms.cxx
+++ b/Tests/CMakeLib/testStringAlgorithms.cxx
@@ -51,6 +51,29 @@ int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
}
// ----------------------------------------------------------------------
+ // Test cmRemoveQuotes
+ {
+ auto test = [&assert_string](cm::string_view source,
+ cm::string_view expected,
+ cm::string_view title) {
+ assert_string(cmRemoveQuotes(source), expected, title);
+ };
+
+ test("", "", "cmRemoveQuotes empty");
+ test("\"", "\"", "cmRemoveQuotes single quote");
+ test("\"\"", "", "cmRemoveQuotes double quote");
+ test("\"a", "\"a", "cmRemoveQuotes quote char");
+ test("\"ab", "\"ab", "cmRemoveQuotes quote char char");
+ test("a\"", "a\"", "cmRemoveQuotes char quote");
+ test("ab\"", "ab\"", "cmRemoveQuotes char char quote");
+ test("a", "a", "cmRemoveQuotes single char");
+ test("ab", "ab", "cmRemoveQuotes two chars");
+ test("abc", "abc", "cmRemoveQuotes three chars");
+ test("\"abc\"", "abc", "cmRemoveQuotes quoted chars");
+ test("\"\"abc\"\"", "\"abc\"", "cmRemoveQuotes quoted quoted chars");
+ }
+
+ // ----------------------------------------------------------------------
// Test cmEscapeQuotes
{
assert_string(cmEscapeQuotes("plain"), "plain", "cmEscapeQuotes plain");
@@ -167,5 +190,40 @@ int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
assert_ok(!cmHasLiteralSuffix(str, "ab"), "cmHasLiteralPrefix string not");
}
+ // ----------------------------------------------------------------------
+ // Test cmStrToLong
+ {
+ long value;
+ assert_ok(cmStrToLong("1", &value) && value == 1,
+ "cmStrToLong parses a positive decimal integer.");
+ assert_ok(cmStrToLong(" 1", &value) && value == 1,
+ "cmStrToLong parses a decimal integer after whitespace.");
+
+ assert_ok(cmStrToLong("-1", &value) && value == -1,
+ "cmStrToLong parses a negative decimal integer.");
+ assert_ok(
+ cmStrToLong(" -1", &value) && value == -1,
+ "cmStrToLong parses a negative decimal integer after whitespace.");
+
+ assert_ok(!cmStrToLong("1x", &value),
+ "cmStrToLong rejects trailing content.");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmStrToULong
+ {
+ unsigned long value;
+ assert_ok(cmStrToULong("1", &value) && value == 1,
+ "cmStrToULong parses a decimal integer.");
+ assert_ok(cmStrToULong(" 1", &value) && value == 1,
+ "cmStrToULong parses a decimal integer after whitespace.");
+ assert_ok(!cmStrToULong("-1", &value),
+ "cmStrToULong rejects a negative number.");
+ assert_ok(!cmStrToULong(" -1", &value),
+ "cmStrToULong rejects a negative number after whitespace.");
+ assert_ok(!cmStrToULong("1x", &value),
+ "cmStrToULong rejects trailing content.");
+ }
+
return failed;
}
diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx
index 121e639..0a757df 100644
--- a/Tests/CMakeLib/testSystemTools.cxx
+++ b/Tests/CMakeLib/testSystemTools.cxx
@@ -94,21 +94,5 @@ int testSystemTools(int /*unused*/, char* /*unused*/ [])
cmPassed("cmSystemTools::strverscmp working");
}
- // ----------------------------------------------------------------------
- // Test cmSystemTools::StringToULong
- {
- unsigned long value;
- cmAssert(cmSystemTools::StringToULong("1", &value) && value == 1,
- "StringToULong parses a decimal integer.");
- cmAssert(cmSystemTools::StringToULong(" 1", &value) && value == 1,
- "StringToULong parses a decimal integer after whitespace.");
- cmAssert(!cmSystemTools::StringToULong("-1", &value),
- "StringToULong rejects a negative number.");
- cmAssert(!cmSystemTools::StringToULong(" -1", &value),
- "StringToULong rejects a negative number after whitespace.");
- cmAssert(!cmSystemTools::StringToULong("1x", &value),
- "StringToULong rejects trailing content.");
- }
-
return failed;
}
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
index 6190089..6e3697f 100644
--- a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
@@ -27,12 +27,12 @@ endif()
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
add_library(CUDANoDeviceResolve SHARED file1.cu)
set_target_properties(CUDANoDeviceResolve
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
- CUDA_RESOLVE_DEVICE_SYMBOLS OFF
POSITION_INDEPENDENT_CODE ON)
if(MSVC)
target_link_options(CUDANoDeviceResolve PRIVATE "/FORCE:UNRESOLVED")
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 169ba07..27838a4 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -6,9 +6,17 @@ foreach(t MultiThreaded SingleThreaded)
foreach(dbg "" Debug)
foreach(dll "" DLL)
set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_${t}${dbg}${dll}")
- # ifort does not actually define these, so inject them
- string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
- string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ # ifort does not actually define these, so inject them
+ string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
+ string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Flang")
+ # flang does not actually define these, so inject them
+ string(REPLACE ";--dependent-lib=libcmt;" ";--dependent-lib=libcmt;-D_MT;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=msvcrt;" ";--dependent-lib=msvcrt;-D_MT;-D_DLL;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=libcmtd;" ";--dependent-lib=libcmtd;-D_MT;-D_DEBUG;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=msvcrtd;" ";--dependent-lib=msvcrtd;-D_MT;-D_DEBUG;-D_DLL;" "${var}" ";${${var}};")
+ endif()
endforeach()
endforeach()
endforeach()
@@ -45,6 +53,6 @@ endfunction()
verify(Fortran verify.F90)
# Intel Fortran for Windows supports single-threaded RTL but it is
# not implemented by the Visual Studio integration.
-if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
verify_combinations(SingleThreaded Fortran verify.F90)
endif()
diff --git a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
index 0a67488..ebd7232 100644
--- a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
+++ b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
@@ -1,2 +1,2 @@
-- Found Boost: [^
-]* \(found suitable version "1\.12345", minimum required is "1\.12345"\) found components: date_time
+]* \(found suitable version "1\.12345", minimum required is "1\.12345"\) found components: date_time
diff --git a/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt b/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt
index a781dce..1175425 100644
--- a/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt
+++ b/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt
@@ -1,5 +1,5 @@
-- Found Boost: [^
-]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
+]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
-- Boost_FOUND: TRUE
-- Boost_INCLUDE_DIRS: [^
]*/Tests/RunCMake/FindBoost/CMakePackage[^/]*/include
diff --git a/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt b/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt
index a4e9c6a..101d60e 100644
--- a/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt
+++ b/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt
@@ -1,5 +1,5 @@
-- Found Boost: [^
-]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
+]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
-- Boost_FOUND: TRUE
-- Boost_INCLUDE_DIRS: [^
]*/Tests/RunCMake/FindBoost/CMakePackage[^/]*/include
diff --git a/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt b/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt
index 8e9d684..9853c01 100644
--- a/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt
+++ b/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt
@@ -1,5 +1,5 @@
-- Found Boost: [^
-]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time *
+]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time *
-- Boost_FOUND: TRUE
-- Boost_INCLUDE_DIRS: [^
]*/Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/include