summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GeneratorExpression
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-13 13:49:53 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-15 15:44:49 (GMT)
commitebf05abda15967f8f50dcf132f7bf84472ca6337 (patch)
tree8f519862ee05d0f2b7d2ef34cfb281841a673461 /Tests/RunCMake/GeneratorExpression
parentcd3bd23266a4a6c00595134a17a8bdaea9e28af5 (diff)
downloadCMake-ebf05abda15967f8f50dcf132f7bf84472ca6337.zip
CMake-ebf05abda15967f8f50dcf132f7bf84472ca6337.tar.gz
CMake-ebf05abda15967f8f50dcf132f7bf84472ca6337.tar.bz2
Add boolean generator expressions
Add generator expressions that combine and use boolean test results: $<0:...> = empty string (ignores "...") $<1:...> = content of "..." $<AND:?[,?]...> = '1' if all '?' are '1', else '0' $<OR:?[,?]...> = '0' if all '?' are '0', else '1' $<NOT:?> = '0' if '?' is '1', else '1' These will be useful to evaluate (future) boolean query expressions and condition content on the results. Include tests and documentation.
Diffstat (limited to 'Tests/RunCMake/GeneratorExpression')
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadAND-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt17
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadAND.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadNOT-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt26
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadNOT.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadOR-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt17
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadOR.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake5
11 files changed, 84 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-result.txt b/Tests/RunCMake/GeneratorExpression/BadAND-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadAND-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt
new file mode 100644
index 0000000..ced21d8
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt
@@ -0,0 +1,17 @@
+CMake Error at BadAND.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<AND:>
+
+ AND requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadAND.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<AND:,>
+
+ AND requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadAND.cmake b/Tests/RunCMake/GeneratorExpression/BadAND.cmake
new file mode 100644
index 0000000..7926540
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadAND.cmake
@@ -0,0 +1,4 @@
+add_custom_target(check ALL COMMAND check
+ $<AND:>
+ $<AND:,>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt
new file mode 100644
index 0000000..5721f5f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt
@@ -0,0 +1,26 @@
+CMake Error at BadNOT.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<NOT:>
+
+ NOT requires exactly one '0' or '1' value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadNOT.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<NOT:,>
+
+ NOT requires exactly one '0' or '1' value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadNOT.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<NOT:0,1>
+
+ NOT requires exactly one '0' or '1' value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT.cmake b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake
new file mode 100644
index 0000000..452293b
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake
@@ -0,0 +1,5 @@
+add_custom_target(check ALL COMMAND check
+ $<NOT:>
+ $<NOT:,>
+ $<NOT:0,1>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-result.txt b/Tests/RunCMake/GeneratorExpression/BadOR-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadOR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt
new file mode 100644
index 0000000..72ef2dd
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt
@@ -0,0 +1,17 @@
+CMake Error at BadOR.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<OR:>
+
+ OR requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadOR.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<OR:,>
+
+ OR requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadOR.cmake b/Tests/RunCMake/GeneratorExpression/BadOR.cmake
new file mode 100644
index 0000000..f16f56a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadOR.cmake
@@ -0,0 +1,4 @@
+add_custom_target(check ALL COMMAND check
+ $<OR:>
+ $<OR:,>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
new file mode 100644
index 0000000..95b16b3
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(BadOR)
+run_cmake(BadAND)
+run_cmake(BadNOT)