summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt7
-rw-r--r--Tests/CMakeTests/CompilerIdVendorTest.cmake.in4
-rw-r--r--Tests/CMakeTests/FileDownloadBadHashTest.cmake.in5
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in5
-rw-r--r--Tests/CMakeTests/FileUploadTest.cmake.in5
-rw-r--r--Tests/Cuda/Complex/CMakeLists.txt8
-rw-r--r--Tests/Cuda/Complex/dynamic.cu51
-rw-r--r--Tests/Cuda/Complex/file3.cu39
-rw-r--r--Tests/Cuda/Complex/main.cpp12
-rw-r--r--Tests/Cuda/Complex/mixed.cu40
-rw-r--r--Tests/Cuda/ObjectLibrary/main.cpp8
-rw-r--r--Tests/Cuda/ObjectLibrary/static.cu4
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription-stdout.txt91
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription.cmake158
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription-stdout.txt46
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription.cmake82
-rw-r--r--Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake5
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake5
-rw-r--r--Tests/RunCMake/file/UPLOAD-unused-argument.cmake5
-rw-r--r--Tests/VSNASM/CMakeLists.txt10
-rw-r--r--Tests/VSNASM/foo.asm7
-rw-r--r--Tests/VSNASM/include/foo-proc.asm7
-rw-r--r--Tests/VSNASM/main.c5
24 files changed, 581 insertions, 30 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 4945b31..910ff39 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2043,7 +2043,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]")
select_wince_sdk(reg_wince wince_sdk)
set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
- foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra)
+ set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]")
+ foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm)
get_filename_component(r "${reg_${reg}}" ABSOLUTE)
if(IS_DIRECTORY "${r}")
set(${reg} 1)
@@ -2134,6 +2135,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
endif()
+ if(CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])" AND nasm)
+ ADD_TEST_MACRO(VSNASM VSNASM)
+ endif()
+
if (CMake_TEST_GreenHillsMULTI)
macro(add_test_GhsMulti name primaryTarget bspName)
add_test(NAME GhsMulti.${name} COMMAND ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/CMakeTests/CompilerIdVendorTest.cmake.in b/Tests/CMakeTests/CompilerIdVendorTest.cmake.in
index 68f6462..9cf5321 100644
--- a/Tests/CMakeTests/CompilerIdVendorTest.cmake.in
+++ b/Tests/CMakeTests/CompilerIdVendorTest.cmake.in
@@ -8,7 +8,6 @@ file(MAKE_DIRECTORY ${MY_BINARY_DIR})
set(CMAKE_MyLang_COMPILER ${CMAKE_COMMAND})
set(CMAKE_MyLang_COMPILER_ID_ARG1)
-set(CMAKE_MyLang_COMPILER_ID_FLAGS_LIST)
set(CMAKE_MyLang_COMPILER_ID_DIR ${MY_BINARY_DIR})
file(WRITE "${MY_BINARY_DIR}/BogusVendor.cmake" "message(\"This is a BogusVendor compiler\")")
@@ -22,7 +21,8 @@ set(CMAKE_MyLang_COMPILER_ID_VENDOR_FLAGS_MyVendor -P MyVendor.cmake)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_REGEX_MyVendor MyVendor)
set(CMAKE_BINARY_DIR ${MY_BINARY_DIR})
-cmake_determine_compiler_id_vendor(MyLang)
+set(userflags)
+cmake_determine_compiler_id_vendor(MyLang "${userflags}")
if("${CMAKE_MyLang_COMPILER_ID}" STREQUAL "MyVendor")
message(STATUS "Found MyVendor compiler id!")
diff --git a/Tests/CMakeTests/FileDownloadBadHashTest.cmake.in b/Tests/CMakeTests/FileDownloadBadHashTest.cmake.in
index 4a47c06..64b45ed 100644
--- a/Tests/CMakeTests/FileDownloadBadHashTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadBadHashTest.cmake.in
@@ -1,4 +1,7 @@
-set(url "file://@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png")
+if(NOT "@CMAKE_CURRENT_SOURCE_DIR@" MATCHES "^/")
+ set(slash /)
+endif()
+set(url "file://${slash}@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png")
set(dir "@CMAKE_CURRENT_BINARY_DIR@/downloads")
file(DOWNLOAD
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
index 83ade2b..f6d9ad9 100644
--- a/Tests/CMakeTests/FileDownloadTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -1,4 +1,7 @@
-set(url "file://@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png")
+if(NOT "@CMAKE_CURRENT_SOURCE_DIR@" MATCHES "^/")
+ set(slash /)
+endif()
+set(url "file://${slash}@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png")
set(dir "@CMAKE_CURRENT_BINARY_DIR@/downloads")
message(STATUS "FileDownload:1")
diff --git a/Tests/CMakeTests/FileUploadTest.cmake.in b/Tests/CMakeTests/FileUploadTest.cmake.in
index 8577aef..9e22909 100644
--- a/Tests/CMakeTests/FileUploadTest.cmake.in
+++ b/Tests/CMakeTests/FileUploadTest.cmake.in
@@ -10,7 +10,10 @@ endif()
file(MAKE_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/uploads")
set(filename "@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png")
-set(urlbase "file://@CMAKE_CURRENT_BINARY_DIR@/uploads")
+if(NOT "@CMAKE_CURRENT_BINARY_DIR@" MATCHES "^/")
+ set(slash /)
+endif()
+set(urlbase "file://${slash}@CMAKE_CURRENT_BINARY_DIR@/uploads")
message(STATUS "FileUpload:1")
file(UPLOAD
diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt
index 9a3703a..2dd6f73 100644
--- a/Tests/Cuda/Complex/CMakeLists.txt
+++ b/Tests/Cuda/Complex/CMakeLists.txt
@@ -32,9 +32,17 @@ add_library(CudaComplexSharedLib SHARED dynamic.cu)
target_link_libraries(CudaComplexSharedLib PUBLIC CudaComplexCppBase)
add_library(CudaComplexMixedLib SHARED mixed.cpp mixed.cu)
+set_target_properties(CudaComplexMixedLib
+ PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(CudaComplexMixedLib
PUBLIC CudaComplexSharedLib
PRIVATE CudaComplexSeperableLib)
add_executable(CudaComplex main.cpp)
target_link_libraries(CudaComplex PUBLIC CudaComplexMixedLib)
+
+if(APPLE)
+ # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
+ # the static cuda runtime can find it at runtime.
+ target_link_libraries(CudaComplex PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+endif()
diff --git a/Tests/Cuda/Complex/dynamic.cu b/Tests/Cuda/Complex/dynamic.cu
index a23dc25..2b04ac9 100644
--- a/Tests/Cuda/Complex/dynamic.cu
+++ b/Tests/Cuda/Complex/dynamic.cu
@@ -22,12 +22,59 @@ void DetermineIfValidCudaDevice()
{
}
+EXPORT int choose_cuda_device()
+{
+ int nDevices = 0;
+ cudaError_t err = cudaGetDeviceCount(&nDevices);
+ if (err != cudaSuccess)
+ {
+ std::cerr << "Failed to retrieve the number of CUDA enabled devices"
+ << std::endl;
+ return 1;
+ }
+ for (int i = 0; i < nDevices; ++i)
+ {
+ cudaDeviceProp prop;
+ cudaError_t err = cudaGetDeviceProperties(&prop, i);
+ if (err != cudaSuccess)
+ {
+ std::cerr << "Could not retrieve properties from CUDA device " << i
+ << std::endl;
+ return 1;
+ }
+ if (prop.major >= 4)
+ {
+ err = cudaSetDevice(i);
+ if (err != cudaSuccess)
+ {
+ std::cout << "Could not select CUDA device " << i << std::endl;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ }
+
+ std::cout << "Could not find a CUDA enabled card supporting compute >=3.0"
+ << std::endl;
+
+ return 1;
+}
+
EXPORT void cuda_dynamic_lib_func()
{
DetermineIfValidCudaDevice <<<1,1>>> ();
cudaError_t err = cudaGetLastError();
- if(err == cudaSuccess)
+ if(err != cudaSuccess)
+ {
+ std::cerr << "DetermineIfValidCudaDevice [SYNC] failed: "
+ << cudaGetErrorString(err) << std::endl;
+ }
+ err = cudaDeviceSynchronize();
+ if(err != cudaSuccess)
{
- std::cerr << cudaGetErrorString(err) << std::endl;
+ std::cerr << "DetermineIfValidCudaDevice [ASYNC] failed: "
+ << cudaGetErrorString(cudaGetLastError()) << std::endl;
}
}
diff --git a/Tests/Cuda/Complex/file3.cu b/Tests/Cuda/Complex/file3.cu
index 47e64c5..bd8198d 100644
--- a/Tests/Cuda/Complex/file3.cu
+++ b/Tests/Cuda/Complex/file3.cu
@@ -9,21 +9,46 @@ result_type_dynamic __device__ file2_func(int x);
static
__global__
-void file3_kernel(result_type& r, int x)
+void file3_kernel(result_type* r, int x)
{
- r = file1_func(x);
+ *r = file1_func(x);
result_type_dynamic rd = file2_func(x);
}
int file3_launch_kernel(int x)
{
- result_type r;
+ result_type* r;
+ cudaError_t err = cudaMallocManaged(&r, sizeof(result_type));
+ if(err != cudaSuccess)
+ {
+ std::cerr << "file3_launch_kernel: cudaMallocManaged failed: "
+ << cudaGetErrorString(err) << std::endl;
+ return x;
+ }
+
file3_kernel <<<1,1>>> (r,x);
- cudaError_t err = cudaGetLastError();
- if(err == cudaSuccess)
+ err = cudaGetLastError();
+ if(err != cudaSuccess)
{
- std::cerr << cudaGetErrorString(err) << std::endl;
+ std::cerr << "file3_kernel [SYNC] failed: "
+ << cudaGetErrorString(err) << std::endl;
return x;
}
- return r.sum;
+ err = cudaDeviceSynchronize();
+ if(err != cudaSuccess)
+ {
+ std::cerr << "file3_kernel [ASYNC] failed: "
+ << cudaGetErrorString(cudaGetLastError()) << std::endl;
+ return x;
+ }
+ int result = r->sum;
+ err = cudaFree(r);
+ if(err != cudaSuccess)
+ {
+ std::cerr << "file3_launch_kernel: cudaFree failed: "
+ << cudaGetErrorString(err) << std::endl;
+ return x;
+ }
+
+ return result;
}
diff --git a/Tests/Cuda/Complex/main.cpp b/Tests/Cuda/Complex/main.cpp
index 5a3f820..2498235 100644
--- a/Tests/Cuda/Complex/main.cpp
+++ b/Tests/Cuda/Complex/main.cpp
@@ -9,12 +9,18 @@
#define IMPORT
#endif
+IMPORT int choose_cuda_device();
IMPORT int call_cuda_seperable_code(int x);
IMPORT int mixed_launch_kernel(int x);
int main(int argc, char** argv)
{
- call_cuda_seperable_code(42);
- mixed_launch_kernel(42);
- return 0;
+ int ret = choose_cuda_device();
+ if (ret) {
+ return 0;
+ }
+
+ int r1 = call_cuda_seperable_code(42);
+ int r2 = mixed_launch_kernel(42);
+ return (r1 == 42 || r2 == 42) ? 1 : 0;
}
diff --git a/Tests/Cuda/Complex/mixed.cu b/Tests/Cuda/Complex/mixed.cu
index 7051de0..d96cc7c 100644
--- a/Tests/Cuda/Complex/mixed.cu
+++ b/Tests/Cuda/Complex/mixed.cu
@@ -19,9 +19,9 @@ IMPORT void __host__ cuda_dynamic_lib_func();
static
__global__
-void mixed_kernel(result_type& r, int x)
+void mixed_kernel(result_type* r, int x)
{
- r = file1_func(x);
+ *r = file1_func(x);
result_type_dynamic rd = file2_func(x);
}
@@ -29,7 +29,39 @@ EXPORT int mixed_launch_kernel(int x)
{
cuda_dynamic_lib_func();
- result_type r;
+ result_type* r;
+ cudaError_t err = cudaMallocManaged(&r, sizeof(result_type));
+ if(err != cudaSuccess)
+ {
+ std::cerr << "mixed_launch_kernel: cudaMallocManaged failed: "
+ << cudaGetErrorString(err) << std::endl;
+ return x;
+ }
+
mixed_kernel <<<1,1>>> (r,x);
- return r.sum;
+ err = cudaGetLastError();
+ if(err != cudaSuccess)
+ {
+ std::cerr << "mixed_kernel [SYNC] failed: "
+ << cudaGetErrorString(err) << std::endl;
+ return x;
+ }
+ err = cudaDeviceSynchronize();
+ if(err != cudaSuccess)
+ {
+ std::cerr << "mixed_kernel [ASYNC] failed: "
+ << cudaGetErrorString(cudaGetLastError()) << std::endl;
+ return x;
+ }
+
+ int result = r->sum;
+ err = cudaFree(r);
+ if(err != cudaSuccess)
+ {
+ std::cerr << "mixed_launch_kernel: cudaFree failed: "
+ << cudaGetErrorString(err) << std::endl;
+ return x;
+ }
+
+ return result;
}
diff --git a/Tests/Cuda/ObjectLibrary/main.cpp b/Tests/Cuda/ObjectLibrary/main.cpp
index 1a70a99..4d2f890 100644
--- a/Tests/Cuda/ObjectLibrary/main.cpp
+++ b/Tests/Cuda/ObjectLibrary/main.cpp
@@ -4,14 +4,16 @@
int static_func(int);
int file1_sq_func(int);
-void test_functions()
+int test_functions()
{
- file1_sq_func(static_func(42));
+ return file1_sq_func(static_func(42));
}
int main(int argc, char** argv)
{
- test_functions();
+ if (test_functions() == 1) {
+ return 1;
+ }
std::cout
<< "this executable doesn't use cuda code, just call methods defined"
<< std::endl;
diff --git a/Tests/Cuda/ObjectLibrary/static.cu b/Tests/Cuda/ObjectLibrary/static.cu
index 2374c23..a801153 100644
--- a/Tests/Cuda/ObjectLibrary/static.cu
+++ b/Tests/Cuda/ObjectLibrary/static.cu
@@ -10,8 +10,8 @@ int __host__ file1_sq_func(int x)
err = cudaGetDeviceCount(&nDevices);
if(err != cudaSuccess)
{
- std::cout << "nDevices: " << nDevices << std::endl;
- std::cout << "err: " << err << std::endl;
+ std::cerr << "nDevices: " << nDevices << std::endl;
+ std::cerr << "err: " << err << std::endl;
return 1;
}
std::cout << "this library uses cuda code" << std::endl;
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription-stdout.txt
new file mode 100644
index 0000000..723c467
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription-stdout.txt
@@ -0,0 +1,91 @@
+-- The following TYPE1 packages have been found:
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- The following TYPE2 packages have not been found:
+
+ \* Bar
+
+-- The following TYPE3 packages have not been found:
+
+ \* Baz
+
+--[ ]
+ \* Foo, The Foo package, <https://foo.example/>
+
+--[ ]
+ \* Bar
+
+--[ ]
+ \* Baz
+
+-- TYPE1 pkgs found
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- TYPE2 pkgs not found
+
+ \* Bar
+
+-- TYPE3 pkgs not found
+
+ \* Baz
+
+-- The following TYPE1 packages have been found:
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- The following TYPE2 packages have not been found:
+
+ \* Bar
+
+-- The following TYPE3 packages have not been found:
+
+ \* Baz
+
+-- The following first type packages have been found:
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- The following second type packages have not been found:
+
+ \* Bar
+
+-- The following third type packages have not been found:
+
+ \* Baz
+
+--[ ]
+ \* Foo, The Foo package, <https://foo.example/>
+
+--[ ]
+ \* Bar
+
+--[ ]
+ \* Baz
+
+-- TYPE1 pkgs found
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- TYPE2 pkgs not found
+
+ \* Bar
+
+-- TYPE3 pkgs not found
+
+ \* Baz
+
+-- The following first type packages have been found:
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- The following second type packages have not been found:
+
+ \* Bar
+
+-- The following third type packages have not been found:
+
+ \* Baz
+
+-- Configuring done
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription.cmake
new file mode 100644
index 0000000..e61b652
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomDescription.cmake
@@ -0,0 +1,158 @@
+include(FeatureSummary)
+set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3)
+
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+find_package(Foo)
+find_package(Bar)
+find_package(Baz)
+
+set_package_properties(Foo PROPERTIES TYPE TYPE1)
+set_package_properties(Bar PROPERTIES TYPE TYPE2)
+set_package_properties(Baz PROPERTIES TYPE TYPE3)
+
+feature_summary(WHAT ALL)
+
+feature_summary(WHAT TYPE1_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE2_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE3_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+
+feature_summary(WHAT TYPE1_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE1 pkgs found\n")
+feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE1 pkgs not found\n")
+feature_summary(WHAT TYPE2_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE2 pkgs found\n")
+feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE2 pkgs not found\n")
+feature_summary(WHAT TYPE3_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE3 pkgs found\n")
+feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE3 pkgs not found\n")
+
+feature_summary(WHAT TYPE1_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE2_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE3_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+
+set_property(GLOBAL PROPERTY FeatureSummary_TYPE1_DESCRIPTION "first type packages")
+set_property(GLOBAL PROPERTY FeatureSummary_TYPE2_DESCRIPTION "second type packages")
+set_property(GLOBAL PROPERTY FeatureSummary_TYPE3_DESCRIPTION "third type packages")
+
+feature_summary(WHAT ALL)
+
+feature_summary(WHAT TYPE1_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE2_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE3_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+
+feature_summary(WHAT TYPE1_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE1 pkgs found\n")
+feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE1 pkgs not found\n")
+feature_summary(WHAT TYPE2_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE2 pkgs found\n")
+feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE2 pkgs not found\n")
+feature_summary(WHAT TYPE3_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE3 pkgs found\n")
+feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "TYPE3 pkgs not found\n")
+
+feature_summary(WHAT TYPE1_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE1_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE2_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE2_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE3_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT TYPE3_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription-stdout.txt
new file mode 100644
index 0000000..47bdee3
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription-stdout.txt
@@ -0,0 +1,46 @@
+-- The following RUNTIME packages have been found:
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- The following OPTIONAL packages have not been found:
+
+ \* Bar
+
+-- The following REQUIRED packages have not been found:
+
+ \* Baz
+
+--[ ]
+ \* Foo, The Foo package, <https://foo.example/>
+
+--[ ]
+ \* Bar
+
+--[ ]
+ \* Baz
+
+-- RUNTIME pkgs found
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- OPTIONAL pkgs not found
+
+ \* Bar
+
+-- REQUIRED pkgs not found
+
+ \* Baz
+
+-- The following RUNTIME packages have been found:
+
+ \* Foo, The Foo package, <https://foo.example/>
+
+-- The following OPTIONAL packages have not been found:
+
+ \* Bar
+
+-- The following REQUIRED packages have not been found:
+
+ \* Baz
+
+-- Configuring done
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription.cmake
new file mode 100644
index 0000000..536fe72
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryDefaultDescription.cmake
@@ -0,0 +1,82 @@
+include(FeatureSummary)
+
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+find_package(Foo)
+find_package(Bar)
+find_package(Baz)
+
+set_package_properties(Foo PROPERTIES TYPE RUNTIME)
+set_package_properties(Bar PROPERTIES TYPE OPTIONAL)
+set_package_properties(Baz PROPERTIES TYPE REQUIRED)
+
+feature_summary(WHAT ALL)
+
+feature_summary(WHAT RUNTIME_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT RUNTIME_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT OPTIONAL_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT OPTIONAL_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT REQUIRED_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY)
+
+feature_summary(WHAT RUNTIME_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "RUNTIME pkgs found\n")
+feature_summary(WHAT RUNTIME_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "RUNTIME pkgs not found\n")
+feature_summary(WHAT OPTIONAL_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "OPTIONAL pkgs found\n")
+feature_summary(WHAT OPTIONAL_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "OPTIONAL pkgs not found\n")
+feature_summary(WHAT REQUIRED_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "REQUIRED pkgs found\n")
+feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DESCRIPTION "REQUIRED pkgs not found\n")
+
+feature_summary(WHAT RUNTIME_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT RUNTIME_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT OPTIONAL_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT OPTIONAL_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT REQUIRED_PACKAGES_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
+feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND
+ INCLUDE_QUIET_PACKAGES
+ QUIET_ON_EMPTY
+ DEFAULT_DESCRIPTION)
diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
index 9caee4c..c672c16 100644
--- a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
@@ -14,8 +14,10 @@ run_cmake(FeatureSummaryFatalOnMissingRequiredPackages)
run_cmake(FeatureSummaryIncludeQuietPackages)
run_cmake(FeatureSummaryQuietOnEmpty)
run_cmake(FeatureSummaryMultipleDepends)
+run_cmake(FeatureSummaryDefaultDescription)
run_cmake(FeatureSummaryCustomTypes)
run_cmake(FeatureSummaryCustomBadDefault)
run_cmake(FeatureSummaryCustomRequired)
run_cmake(FeatureSummaryCustomRequiredListA)
run_cmake(FeatureSummaryCustomRequiredListB)
+run_cmake(FeatureSummaryCustomDescription)
diff --git a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake
index ca72692..a91b217 100644
--- a/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake
+++ b/Tests/RunCMake/file/DOWNLOAD-hash-mismatch.cmake
@@ -1,5 +1,8 @@
+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^/")
+ set(slash /)
+endif()
file(DOWNLOAD
- "file://${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-hash-mismatch.txt"
+ "file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-hash-mismatch.txt"
${CMAKE_CURRENT_BINARY_DIR}/hash-mismatch.txt
EXPECTED_HASH SHA1=0123456789abcdef0123456789abcdef01234567
STATUS status
diff --git a/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake b/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake
index 2e3fbe1..2fa5482 100644
--- a/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake
+++ b/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake
@@ -1,5 +1,8 @@
+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^/")
+ set(slash /)
+endif()
file(DOWNLOAD
- "file://${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-unused-argument.txt"
+ "file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-unused-argument.txt"
"${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt"
JUNK
)
diff --git a/Tests/RunCMake/file/UPLOAD-unused-argument.cmake b/Tests/RunCMake/file/UPLOAD-unused-argument.cmake
index 94ac9ac..92c878c 100644
--- a/Tests/RunCMake/file/UPLOAD-unused-argument.cmake
+++ b/Tests/RunCMake/file/UPLOAD-unused-argument.cmake
@@ -1,5 +1,8 @@
+if(NOT "${CMAKE_CURRENT_BINARY_DIR}" MATCHES "^/")
+ set(slash /)
+endif()
file(UPLOAD
"${CMAKE_CURRENT_SOURCE_DIR}/UPLOAD-unused-argument.txt"
- "file://${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt"
+ "file://${slash}${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt"
JUNK
)
diff --git a/Tests/VSNASM/CMakeLists.txt b/Tests/VSNASM/CMakeLists.txt
new file mode 100644
index 0000000..c2e29df
--- /dev/null
+++ b/Tests/VSNASM/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(VSNASM C ASM_NASM)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ add_definitions(-DTESTx64)
+ string(APPEND CMAKE_ASM_NASM_FLAGS " -DTEST2x64")
+else()
+ add_definitions(-DTESTi386)
+endif()
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+add_executable(VSNASM main.c foo.asm)
diff --git a/Tests/VSNASM/foo.asm b/Tests/VSNASM/foo.asm
new file mode 100644
index 0000000..aba0673
--- /dev/null
+++ b/Tests/VSNASM/foo.asm
@@ -0,0 +1,7 @@
+section .text
+%ifdef TEST2x64
+global foo
+%else
+global _foo
+%endif
+%include "foo-proc.asm"
diff --git a/Tests/VSNASM/include/foo-proc.asm b/Tests/VSNASM/include/foo-proc.asm
new file mode 100644
index 0000000..450a791
--- /dev/null
+++ b/Tests/VSNASM/include/foo-proc.asm
@@ -0,0 +1,7 @@
+%ifdef TESTx64
+foo:
+%else
+_foo:
+%endif
+ mov eax, 0
+ ret
diff --git a/Tests/VSNASM/main.c b/Tests/VSNASM/main.c
new file mode 100644
index 0000000..18ddb78
--- /dev/null
+++ b/Tests/VSNASM/main.c
@@ -0,0 +1,5 @@
+extern int foo(void);
+int main(void)
+{
+ return foo();
+}