summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/MSVCRuntimeLibrary/CMakeLists.txt7
-rw-r--r--Tests/MSVCRuntimeLibrary/verify.cu1
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAware-check.cmake41
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAware.cmake19
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt1
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt3
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake8
-rw-r--r--Tests/RunCMake/list/POP_FRONT.cmake13
10 files changed, 96 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a81ea5b..b8b7e21 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1883,6 +1883,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_TEST_MACRO(PrecompiledHeader foo)
endif()
+ set(MSVCRuntimeLibrary_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
ADD_TEST_MACRO(MSVCRuntimeLibrary)
if(CMAKE_Fortran_COMPILER)
ADD_TEST_MACRO(MSVCRuntimeLibrary.Fortran)
diff --git a/Tests/MSVCRuntimeLibrary/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/CMakeLists.txt
index 6994d8d..f7d9fec 100644
--- a/Tests/MSVCRuntimeLibrary/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/CMakeLists.txt
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.14)
cmake_policy(SET CMP0091 NEW)
project(MSVCRuntimeLibrary)
+if(CMake_TEST_CUDA)
+ enable_language(CUDA)
+endif()
+
function(verify_combinations threads lang src)
set(verify_tc_config_ Release)
set(verify_tc_config_Debug Debug)
@@ -62,3 +66,6 @@ endfunction()
verify(C verify.c)
verify(CXX verify.cxx)
+if(CMake_TEST_CUDA)
+ verify(CUDA verify.cu)
+endif()
diff --git a/Tests/MSVCRuntimeLibrary/verify.cu b/Tests/MSVCRuntimeLibrary/verify.cu
new file mode 100644
index 0000000..741bca6
--- /dev/null
+++ b/Tests/MSVCRuntimeLibrary/verify.cu
@@ -0,0 +1 @@
+#include "verify.h"
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 55ca9ea..5b2c7cb 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -22,6 +22,8 @@ run_cmake(VsSdkDirectories)
run_cmake(VsGlobals)
run_cmake(VsProjectImport)
run_cmake(VsPackageReferences)
+run_cmake(VsDpiAware)
+run_cmake(VsDpiAwareBadParam)
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
run_cmake(VsJustMyCode)
diff --git a/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake b/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake
new file mode 100644
index 0000000..fbb64f0
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake
@@ -0,0 +1,41 @@
+macro(VSDpiAware_check tgt dpiaware_match_expect)
+ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${tgt}.vcxproj")
+ if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not exist.")
+ return()
+ endif()
+
+ set(HAVE_DPIAWARE_MATCH 0)
+ set(IN_MANIFEST_SETTINGS 0)
+
+ file(STRINGS "${vcProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<Manifest>")
+ set(IN_MANIFEST_SETTINGS 1)
+ elseif(line MATCHES "^ *</Manifest>")
+ set(IN_MANIFEST_SETTINGS 0)
+ elseif(IN_MANIFEST_SETTINGS AND (line MATCHES "^ *<EnableDpiAwareness>([^<>]+)</EnableDpiAwareness>"))
+ set(dpiaware_match_actual "${CMAKE_MATCH_1}")
+ if(NOT "${dpiaware_match_actual}" STREQUAL "${dpiaware_match_expect}")
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj has <EnableDpiAwareness> '${dpiaware_match_actual}', not '${dpiaware_match_expect}'.")
+ return()
+ endif()
+ set(HAVE_DPIAWARE_MATCH 1)
+ break()
+ endif()
+ endforeach()
+
+ if(NOT HAVE_DPIAWARE_MATCH AND NOT "${dpiaware_match_expect}" STREQUAL "")
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <EnableDpiAwareness> property group.")
+ return()
+ endif()
+endmacro()
+
+VSDpiAware_check(DPIAWARE-default-C "")
+VSDpiAware_check(DPIAWARE-default-CXX "")
+VSDpiAware_check(DPIAWARE-TGT-PERMONITOR-C "PerMonitorHighDPIAware")
+VSDpiAware_check(DPIAWARE-TGT-PERMONITOR-CXX "PerMonitorHighDPIAware")
+VSDpiAware_check(DPIAWARE-TGT-ON-C "true")
+VSDpiAware_check(DPIAWARE-TGT-ON-CXX "true")
+VSDpiAware_check(DPIAWARE-TGT-OFF-C "false")
+VSDpiAware_check(DPIAWARE-TGT-OFF-CXX "false")
diff --git a/Tests/RunCMake/VS10Project/VsDpiAware.cmake b/Tests/RunCMake/VS10Project/VsDpiAware.cmake
new file mode 100644
index 0000000..74e3d21
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAware.cmake
@@ -0,0 +1,19 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(C)
+enable_language(CXX)
+
+add_executable(DPIAWARE-default-C empty.c)
+add_executable(DPIAWARE-default-CXX empty.cxx)
+
+add_executable(DPIAWARE-TGT-PERMONITOR-C empty.c)
+set_property(TARGET DPIAWARE-TGT-PERMONITOR-C PROPERTY VS_DPI_AWARE "PerMonitor")
+add_executable(DPIAWARE-TGT-PERMONITOR-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-PERMONITOR-CXX PROPERTY VS_DPI_AWARE "PerMonitor")
+add_executable(DPIAWARE-TGT-ON-C empty.c)
+set_property(TARGET DPIAWARE-TGT-ON-C PROPERTY VS_DPI_AWARE ON)
+add_executable(DPIAWARE-TGT-ON-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-ON-CXX PROPERTY VS_DPI_AWARE ON)
+add_executable(DPIAWARE-TGT-OFF-C empty.c)
+set_property(TARGET DPIAWARE-TGT-OFF-C PROPERTY VS_DPI_AWARE OFF)
+add_executable(DPIAWARE-TGT-OFF-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-OFF-CXX PROPERTY VS_DPI_AWARE OFF)
diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt
new file mode 100644
index 0000000..95fc5ca
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error: Bad parameter for VS_DPI_AWARE: Bar
+CMake Error: Bad parameter for VS_DPI_AWARE: Foo
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake
new file mode 100644
index 0000000..e05452b
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake
@@ -0,0 +1,8 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(C)
+enable_language(CXX)
+
+add_executable(DPIAWARE-TGT-BADPARAM-C empty.c)
+set_property(TARGET DPIAWARE-TGT-BADPARAM-C PROPERTY VS_DPI_AWARE "Foo")
+add_executable(DPIAWARE-TGT-BADPARAM-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-BADPARAM-CXX PROPERTY VS_DPI_AWARE "Bar")
diff --git a/Tests/RunCMake/list/POP_FRONT.cmake b/Tests/RunCMake/list/POP_FRONT.cmake
index a2f8f3c..70f757a 100644
--- a/Tests/RunCMake/list/POP_FRONT.cmake
+++ b/Tests/RunCMake/list/POP_FRONT.cmake
@@ -77,3 +77,16 @@ endif()
if(NOT test STREQUAL "two")
message(FATAL_ERROR "`test` has unexpected value `${test}`")
endif()
+
+# BUG 19436
+set(myList a b c)
+list(POP_FRONT myList first second)
+if(NOT first STREQUAL "a")
+ message(FATAL_ERROR "BUG#19436: `first` has unexpected value `${first}`")
+endif()
+if(NOT second STREQUAL "b")
+ message(FATAL_ERROR "BUG#19436: `second` has unexpected value `${second}`")
+endif()
+if(NOT myList STREQUAL "c")
+ message(FATAL_ERROR "BUG#19436: `myList` has unexpected value `${myList}`")
+endif()