FeatureSummary: Add unit tests
This commit is contained in:
parent
d348cd1bc5
commit
8372b4553b
|
@ -42,6 +42,7 @@ add_RunCMake_test(CompilerNotFound)
|
||||||
add_RunCMake_test(Configure)
|
add_RunCMake_test(Configure)
|
||||||
add_RunCMake_test(DisallowedCommands)
|
add_RunCMake_test(DisallowedCommands)
|
||||||
add_RunCMake_test(ExternalData)
|
add_RunCMake_test(ExternalData)
|
||||||
|
add_RunCMake_test(FeatureSummary)
|
||||||
add_RunCMake_test(FPHSA)
|
add_RunCMake_test(FPHSA)
|
||||||
add_RunCMake_test(GeneratorExpression)
|
add_RunCMake_test(GeneratorExpression)
|
||||||
add_RunCMake_test(GeneratorToolset)
|
add_RunCMake_test(GeneratorToolset)
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
|
project(${RunCMake_TEST} NONE)
|
||||||
|
include(${RunCMake_TEST}.cmake)
|
|
@ -0,0 +1,7 @@
|
||||||
|
-- The following features have been enabled:
|
||||||
|
|
||||||
|
\* Foo , Foo\.
|
||||||
|
|
||||||
|
-- The following features have been disabled:
|
||||||
|
|
||||||
|
\* Bar , Bar\.
|
|
@ -0,0 +1,9 @@
|
||||||
|
include(FeatureSummary)
|
||||||
|
|
||||||
|
set(WITH_FOO 1)
|
||||||
|
set(WITH_BAR 0)
|
||||||
|
|
||||||
|
add_feature_info(Foo WITH_FOO "Foo.")
|
||||||
|
add_feature_info(Bar WITH_BAR "Bar.")
|
||||||
|
|
||||||
|
feature_summary(WHAT ALL)
|
|
@ -0,0 +1,7 @@
|
||||||
|
-- The following features have been disabled:
|
||||||
|
|
||||||
|
\* Bar , Bar\.
|
||||||
|
|
||||||
|
-- The following features have been enabled:
|
||||||
|
|
||||||
|
\* Foo , Foo\.
|
|
@ -0,0 +1,9 @@
|
||||||
|
include(FeatureSummary)
|
||||||
|
|
||||||
|
set(WITH_FOO 1)
|
||||||
|
set(WITH_BAR 0)
|
||||||
|
|
||||||
|
add_feature_info(Foo WITH_FOO "Foo.")
|
||||||
|
add_feature_info(Bar WITH_BAR "Bar.")
|
||||||
|
|
||||||
|
feature_summary(WHAT DISABLED_FEATURES ENABLED_FEATURES)
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
|
@ -0,0 +1,6 @@
|
||||||
|
CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\):
|
||||||
|
The WHAT argument of FEATURE_SUMMARY\(\) contains ALL, which cannot be
|
||||||
|
combined with other values\.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
FeatureSummaryWhatListAll\.cmake:[0-9]+ \(feature_summary\)
|
||||||
|
CMakeLists.txt:[0-9]+ \(include\)
|
|
@ -0,0 +1,9 @@
|
||||||
|
include(FeatureSummary)
|
||||||
|
|
||||||
|
set(WITH_FOO 1)
|
||||||
|
set(WITH_BAR 0)
|
||||||
|
|
||||||
|
add_feature_info(Foo WITH_FOO "Foo.")
|
||||||
|
add_feature_info(Bar WITH_BAR "Bar.")
|
||||||
|
|
||||||
|
feature_summary(WHAT ENABLED_FEATURES ALL)
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
|
@ -0,0 +1,6 @@
|
||||||
|
CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\):
|
||||||
|
The WHAT argument of FEATURE_SUMMARY\(\) contains FOO, which is not a valid
|
||||||
|
value\.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
FeatureSummaryWhatListUnknown\.cmake:[0-9]+ \(feature_summary\)
|
||||||
|
CMakeLists.txt:[0-9]+ \(include\)
|
|
@ -0,0 +1,9 @@
|
||||||
|
include(FeatureSummary)
|
||||||
|
|
||||||
|
set(WITH_FOO 1)
|
||||||
|
set(WITH_BAR 0)
|
||||||
|
|
||||||
|
add_feature_info(Foo WITH_FOO "Foo.")
|
||||||
|
add_feature_info(Bar WITH_BAR "Bar.")
|
||||||
|
|
||||||
|
feature_summary(WHAT ENABLED_FEATURES FOO)
|
|
@ -0,0 +1 @@
|
||||||
|
\* Foo , Foo\.
|
|
@ -0,0 +1,9 @@
|
||||||
|
include(FeatureSummary)
|
||||||
|
|
||||||
|
set(WITH_FOO 1)
|
||||||
|
set(WITH_BAR 0)
|
||||||
|
|
||||||
|
add_feature_info(Foo WITH_FOO "Foo.")
|
||||||
|
add_feature_info(Bar WITH_BAR "Bar.")
|
||||||
|
|
||||||
|
feature_summary(WHAT ENABLED_FEATURES)
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
|
@ -0,0 +1,6 @@
|
||||||
|
CMake Error at .*/Modules/FeatureSummary\.cmake:[0-9]+. \(message\):
|
||||||
|
The WHAT argument of FEATURE_SUMMARY\(\) contains FOO, which is not a valid
|
||||||
|
value\.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
FeatureSummaryWhatSingleUnknown\.cmake:[0-9]+ \(feature_summary\)
|
||||||
|
CMakeLists.txt:[0-9]+ \(include\)
|
|
@ -0,0 +1,9 @@
|
||||||
|
include(FeatureSummary)
|
||||||
|
|
||||||
|
set(WITH_FOO 1)
|
||||||
|
set(WITH_BAR 0)
|
||||||
|
|
||||||
|
add_feature_info(Foo WITH_FOO "Foo.")
|
||||||
|
add_feature_info(Bar WITH_BAR "Bar.")
|
||||||
|
|
||||||
|
feature_summary(WHAT FOO)
|
|
@ -0,0 +1,8 @@
|
||||||
|
include(RunCMake)
|
||||||
|
|
||||||
|
run_cmake(FeatureSummaryWhatAll)
|
||||||
|
run_cmake(FeatureSummaryWhatSingle)
|
||||||
|
run_cmake(FeatureSummaryWhatSingleUnknown)
|
||||||
|
run_cmake(FeatureSummaryWhatList)
|
||||||
|
run_cmake(FeatureSummaryWhatListUnknown)
|
||||||
|
run_cmake(FeatureSummaryWhatListAll)
|
Loading…
Reference in New Issue