summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/list
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2018-10-11 21:23:12 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2018-10-16 18:31:39 (GMT)
commitacfe53c58817c662b935fbe0f0443de298371731 (patch)
tree7b2e3dcee64622cbc0f2d514cd0b2727c0ddbc0d /Tests/RunCMake/list
parentbf572ac952d7ddf2b7208efc56f104844aea72e2 (diff)
downloadCMake-acfe53c58817c662b935fbe0f0443de298371731.zip
CMake-acfe53c58817c662b935fbe0f0443de298371731.tar.gz
CMake-acfe53c58817c662b935fbe0f0443de298371731.tar.bz2
cmListCommand: make list(ACTION not_a_list) succeed when idempotent
The operations changed here all are no-ops on empty lists anyways, so just have them succeed when given non-extant lists. - `list(REMOVE_ITEM)` - `list(REMOVE_DUPLICATES)` - `list(SORT)` - `list(FILTER)` - `list(REVERSE)`
Diffstat (limited to 'Tests/RunCMake/list')
-rw-r--r--Tests/RunCMake/list/FILTER-NotList-result.txt1
-rw-r--r--Tests/RunCMake/list/FILTER-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/FILTER-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt1
-rw-r--r--Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt1
-rw-r--r--Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/REVERSE-NotList-result.txt1
-rw-r--r--Tests/RunCMake/list/REVERSE-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/REVERSE-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/SORT-NotList-result.txt1
-rw-r--r--Tests/RunCMake/list/SORT-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/SORT-NotList.cmake4
15 files changed, 20 insertions, 25 deletions
diff --git a/Tests/RunCMake/list/FILTER-NotList-result.txt b/Tests/RunCMake/list/FILTER-NotList-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/list/FILTER-NotList-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/list/FILTER-NotList-stderr.txt b/Tests/RunCMake/list/FILTER-NotList-stderr.txt
deleted file mode 100644
index 159c28d..0000000
--- a/Tests/RunCMake/list/FILTER-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at FILTER-NotList.cmake:2 \(list\):
- list sub-command FILTER requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-NotList.cmake b/Tests/RunCMake/list/FILTER-NotList.cmake
index 1e15635..bf09ec7 100644
--- a/Tests/RunCMake/list/FILTER-NotList.cmake
+++ b/Tests/RunCMake/list/FILTER-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(FILTER nosuchlist EXCLUDE REGEX "^FILTER_THIS_.+")
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(FILTER) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt
deleted file mode 100644
index 96f3446..0000000
--- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at REMOVE_DUPLICATES-NotList.cmake:2 \(list\):
- list sub-command REMOVE_DUPLICATES requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake
index 218f227..b9f3999 100644
--- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake
+++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(REMOVE_DUPLICATES nosuchlist)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(REMOVE_DUPLICATES) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt b/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt
deleted file mode 100644
index c32a4c0..0000000
--- a/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at REMOVE_ITEM-NotList.cmake:2 \(list\):
- list sub-command REMOVE_ITEM requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake b/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake
index 079e7fb..0c66837 100644
--- a/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake
+++ b/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(REMOVE_ITEM nosuchlist alpha)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(REMOVE_ITEM) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/REVERSE-NotList-result.txt b/Tests/RunCMake/list/REVERSE-NotList-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/list/REVERSE-NotList-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/list/REVERSE-NotList-stderr.txt b/Tests/RunCMake/list/REVERSE-NotList-stderr.txt
deleted file mode 100644
index e9dcc06..0000000
--- a/Tests/RunCMake/list/REVERSE-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at REVERSE-NotList.cmake:2 \(list\):
- list sub-command REVERSE requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REVERSE-NotList.cmake b/Tests/RunCMake/list/REVERSE-NotList.cmake
index 977e2cc..7138329 100644
--- a/Tests/RunCMake/list/REVERSE-NotList.cmake
+++ b/Tests/RunCMake/list/REVERSE-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(REVERSE nosuchlist)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(REVERSE) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/SORT-NotList-result.txt b/Tests/RunCMake/list/SORT-NotList-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/list/SORT-NotList-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/list/SORT-NotList-stderr.txt b/Tests/RunCMake/list/SORT-NotList-stderr.txt
deleted file mode 100644
index 396c5b5..0000000
--- a/Tests/RunCMake/list/SORT-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at SORT-NotList.cmake:2 \(list\):
- list sub-command SORT requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/SORT-NotList.cmake b/Tests/RunCMake/list/SORT-NotList.cmake
index 8f48e10..6314f14 100644
--- a/Tests/RunCMake/list/SORT-NotList.cmake
+++ b/Tests/RunCMake/list/SORT-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(SORT nosuchlist)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(SORT) created our list")
+endif ()