diff options
Diffstat (limited to 'Tests')
18 files changed, 208 insertions, 0 deletions
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-stderr.txt new file mode 100644 index 0000000..58f6125 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + Bad package property type OPTIONAL used in global property + FeatureSummary_DEFAULT_PKG_TYPE. Valid types are TYPE1, TYPE2 and TYPE3. + Either update FeatureSummary_DEFAULT_PKG_TYPE or add OPTIONAL to the + FeatureSummary_PKG_TYPES global property. +Call Stack \(most recent call first\): + .*/Modules/FeatureSummary\.cmake:[0-9]+. \(_FS_GET_FEATURE_SUMMARY\) + FeatureSummaryCustomBadDefault.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault.cmake new file mode 100644 index 0000000..7e2fd55 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomBadDefault.cmake @@ -0,0 +1,8 @@ +include(FeatureSummary) +set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +find_package(Foo) + +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stderr.txt new file mode 100644 index 0000000..e37b9f5 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + feature_summary\(\) Error: REQUIRED package\(s\) are missing, aborting CMake + run. +Call Stack \(most recent call first\): + FeatureSummaryCustomRequired.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stdout.txt new file mode 100644 index 0000000..ecca71f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired-stdout.txt @@ -0,0 +1,17 @@ +-- The following TYPE3 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 been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have not been found: + + \* Bar + +-- Configuring incomplete, errors occurred! diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired.cmake new file mode 100644 index 0000000..11cf04c --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequired.cmake @@ -0,0 +1,16 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_REQUIRED_PKG_TYPES TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_DEFAULT_PKG_TYPE TYPE2) + +find_package(Foo) +find_package(Bar) + +set_package_properties(Foo PROPERTIES TYPE TYPE3) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) + +set_package_properties(Bar PROPERTIES TYPE TYPE3) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stderr.txt new file mode 100644 index 0000000..c9d8b4b --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + feature_summary\(\) Error: REQUIRED package\(s\) are missing, aborting CMake + run. +Call Stack \(most recent call first\): + FeatureSummaryCustomRequiredListA.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stdout.txt new file mode 100644 index 0000000..b12d53a --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA-stdout.txt @@ -0,0 +1,17 @@ +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE1 packages have not been found: + + \* Bar + +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have not been found: + + \* Bar + +-- Configuring incomplete, errors occurred! diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA.cmake new file mode 100644 index 0000000..53111be --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListA.cmake @@ -0,0 +1,16 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_REQUIRED_PKG_TYPES TYPE2 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_DEFAULT_PKG_TYPE TYPE1) + +find_package(Foo) +find_package(Bar) + +set_package_properties(Foo PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) + +set_package_properties(Bar PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stderr.txt new file mode 100644 index 0000000..8ef7a8d --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\): + feature_summary\(\) Error: REQUIRED package\(s\) are missing, aborting CMake + run. +Call Stack \(most recent call first\): + FeatureSummaryCustomRequiredListB.cmake:[0-9]+ \(feature_summary\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stdout.txt new file mode 100644 index 0000000..5f07173 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB-stdout.txt @@ -0,0 +1,17 @@ +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE1 packages have not been found: + + \* Bar + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have not been found: + + \* Bar + +-- Configuring incomplete, errors occurred! diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake new file mode 100644 index 0000000..526b979 --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomRequiredListB.cmake @@ -0,0 +1,16 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_REQUIRED_PKG_TYPES TYPE2 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_DEFAULT_PKG_TYPE TYPE1) + +find_package(Foo) +find_package(Bar) + +set_package_properties(Foo PROPERTIES TYPE TYPE3) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) + +set_package_properties(Bar PROPERTIES TYPE TYPE3) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes-stdout.txt new file mode 100644 index 0000000..a7f973b --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes-stdout.txt @@ -0,0 +1,29 @@ +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE1 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE2 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- The following TYPE3 packages have been found: + + \* Foo, The Foo package, <https://foo.example/> + +-- Configuring done diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes.cmake new file mode 100644 index 0000000..34b0c1f --- /dev/null +++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryCustomTypes.cmake @@ -0,0 +1,36 @@ +include(FeatureSummary) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +set_property(GLOBAL PROPERTY FeatureSummary_PKG_TYPES TYPE1 TYPE2 TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_REQUIRED_PKG_TYPES TYPE3) +set_property(GLOBAL PROPERTY FeatureSummary_DEFAULT_PKG_TYPE TYPE2) + +find_package(Foo) + +# Type not set => TYPE2 +feature_summary(WHAT ALL) + +# TYPE1 > not set => TYPE1 +set_package_properties(Foo PROPERTIES TYPE TYPE1) +feature_summary(WHAT ALL) + +# TYPE2 > TYPE1 => TYPE2 +set_package_properties(Foo PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL) + +# TYPE1 < TYPE2 => TYPE2 +set_package_properties(Foo PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL) + +# TYPE3 > TYPE2 => TYPE3 +set_package_properties(Foo PROPERTIES TYPE TYPE3) +feature_summary(WHAT ALL) + +# TYPE2 < TYPE3 => TYPE3 +set_package_properties(Foo PROPERTIES TYPE TYPE2) +feature_summary(WHAT ALL) + +# TYPE1 < TYPE3 => TYPE3 +set_package_properties(Foo PROPERTIES TYPE TYPE1) +feature_summary(WHAT ALL) diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake index 97c23f9..9caee4c 100644 --- a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake +++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake @@ -14,3 +14,8 @@ run_cmake(FeatureSummaryFatalOnMissingRequiredPackages) run_cmake(FeatureSummaryIncludeQuietPackages) run_cmake(FeatureSummaryQuietOnEmpty) run_cmake(FeatureSummaryMultipleDepends) +run_cmake(FeatureSummaryCustomTypes) +run_cmake(FeatureSummaryCustomBadDefault) +run_cmake(FeatureSummaryCustomRequired) +run_cmake(FeatureSummaryCustomRequiredListA) +run_cmake(FeatureSummaryCustomRequiredListB) |