summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FeatureSummary
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-05 16:07:55 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-03-05 16:07:55 (GMT)
commitf0dcbb17721e777bef3be6b2f4011fefaa6fbbf0 (patch)
treee4314f70d2d16c5d8a85b1f5244976d69baa097d /Tests/RunCMake/FeatureSummary
parentea95e3eae32b35711e23de30b4cbdb5ad2bd930a (diff)
parent8372b4553bc58c00ad3ef923919ff5547746b95e (diff)
downloadCMake-f0dcbb17721e777bef3be6b2f4011fefaa6fbbf0.zip
CMake-f0dcbb17721e777bef3be6b2f4011fefaa6fbbf0.tar.gz
CMake-f0dcbb17721e777bef3be6b2f4011fefaa6fbbf0.tar.bz2
Merge topic 'FeatureSummary_combine_WHAT_values'
8372b455 FeatureSummary: Add unit tests d348cd1b FeatureSummary: Allow to combine and reorder values for the "WHAT" option
Diffstat (limited to 'Tests/RunCMake/FeatureSummary')
-rw-r--r--Tests/RunCMake/FeatureSummary/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt7
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake9
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt7
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake9
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt1
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt6
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake9
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt1
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt6
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake9
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt1
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake9
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt1
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt6
-rw-r--r--Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake9
-rw-r--r--Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake8
17 files changed, 101 insertions, 0 deletions
diff --git a/Tests/RunCMake/FeatureSummary/CMakeLists.txt b/Tests/RunCMake/FeatureSummary/CMakeLists.txt
new file mode 100644
index 0000000..72abfc8
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.11)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt
new file mode 100644
index 0000000..9a3f023
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll-stdout.txt
@@ -0,0 +1,7 @@
+-- The following features have been enabled:
+
+ \* Foo , Foo\.
+
+-- The following features have been disabled:
+
+ \* Bar , Bar\.
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake
new file mode 100644
index 0000000..ec5ebcb
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatAll.cmake
@@ -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)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt
new file mode 100644
index 0000000..4d8f25f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList-stdout.txt
@@ -0,0 +1,7 @@
+-- The following features have been disabled:
+
+ \* Bar , Bar\.
+
+-- The following features have been enabled:
+
+ \* Foo , Foo\.
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake
new file mode 100644
index 0000000..d04ba88
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatList.cmake
@@ -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)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt
new file mode 100644
index 0000000..18d9ebd
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll-stderr.txt
@@ -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\)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake
new file mode 100644
index 0000000..1877ea5
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListAll.cmake
@@ -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)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt
new file mode 100644
index 0000000..3ad3750
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown-stderr.txt
@@ -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\)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake
new file mode 100644
index 0000000..46088d4
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatListUnknown.cmake
@@ -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)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt
new file mode 100644
index 0000000..240632d
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle-stdout.txt
@@ -0,0 +1 @@
+ \* Foo , Foo\.
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake
new file mode 100644
index 0000000..593dfb6
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingle.cmake
@@ -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)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt
new file mode 100644
index 0000000..c78853c
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown-stderr.txt
@@ -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\)
diff --git a/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake
new file mode 100644
index 0000000..c2d6d2e
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/FeatureSummaryWhatSingleUnknown.cmake
@@ -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)
diff --git a/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
new file mode 100644
index 0000000..1417338
--- /dev/null
+++ b/Tests/RunCMake/FeatureSummary/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(FeatureSummaryWhatAll)
+run_cmake(FeatureSummaryWhatSingle)
+run_cmake(FeatureSummaryWhatSingleUnknown)
+run_cmake(FeatureSummaryWhatList)
+run_cmake(FeatureSummaryWhatListUnknown)
+run_cmake(FeatureSummaryWhatListAll)