summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/File_Generate
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/File_Generate')
-rw-r--r--Tests/RunCMake/File_Generate/BadCondition-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/BadCondition-stderr.txt3
-rw-r--r--Tests/RunCMake/File_Generate/BadCondition.cmake5
-rw-r--r--Tests/RunCMake/File_Generate/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/File_Generate/CommandConflict-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/CommandConflict-stderr.txt1
-rw-r--r--Tests/RunCMake/File_Generate/CommandConflict.cmake9
-rw-r--r--Tests/RunCMake/File_Generate/DebugEvaluate.cmake5
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition1-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition1.cmake5
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition2-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition2.cmake5
-rw-r--r--Tests/RunCMake/File_Generate/OutputConflict-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/OutputConflict-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/OutputConflict.cmake4
-rw-r--r--Tests/RunCMake/File_Generate/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/File_Generate/input.txt1
19 files changed, 69 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/BadCondition-result.txt b/Tests/RunCMake/File_Generate/BadCondition-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/BadCondition-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/BadCondition-stderr.txt b/Tests/RunCMake/File_Generate/BadCondition-stderr.txt
new file mode 100644
index 000000000..bab836843
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/BadCondition-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error in CMakeLists.txt:
+ Evaluation file condition \"\$<1:Bad>\" did not evaluate to valid content.
+ Got \"Bad\".
diff --git a/Tests/RunCMake/File_Generate/BadCondition.cmake b/Tests/RunCMake/File_Generate/BadCondition.cmake
new file mode 100644
index 000000000..82ad672ad
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/BadCondition.cmake
@@ -0,0 +1,5 @@
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ CONDITION $<1:Bad>
+)
diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt
new file mode 100644
index 000000000..12cd3c775
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/File_Generate/CommandConflict-result.txt b/Tests/RunCMake/File_Generate/CommandConflict-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CommandConflict-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt b/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt
new file mode 100644
index 000000000..da97ba476
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt
@@ -0,0 +1 @@
+CMake Error: File to be generated by multiple different commands: .*CommandConflict-build/output_.*.txt
diff --git a/Tests/RunCMake/File_Generate/CommandConflict.cmake b/Tests/RunCMake/File_Generate/CommandConflict.cmake
new file mode 100644
index 000000000..d57bc1284
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CommandConflict.cmake
@@ -0,0 +1,9 @@
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_$<CONFIGURATION>.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ CONDITION $<CONFIG:$<CONFIGURATION>>
+)
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_$<CONFIGURATION>.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ CONDITION $<CONFIG:$<CONFIGURATION>>
+)
diff --git a/Tests/RunCMake/File_Generate/DebugEvaluate.cmake b/Tests/RunCMake/File_Generate/DebugEvaluate.cmake
new file mode 100644
index 000000000..1fa9b62bb
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/DebugEvaluate.cmake
@@ -0,0 +1,5 @@
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ CONDITION $<CONFIG:Debug>
+)
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt
new file mode 100644
index 000000000..9fe39cca6
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at EmptyCondition1.cmake:2 \(file\):
+ file Incorrect arguments to GENERATE subcommand.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1.cmake b/Tests/RunCMake/File_Generate/EmptyCondition1.cmake
new file mode 100644
index 000000000..8574a5f7d
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/EmptyCondition1.cmake
@@ -0,0 +1,5 @@
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ CONDITION
+)
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt
new file mode 100644
index 000000000..73d5f2504
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at EmptyCondition2.cmake:2 \(file\):
+ file CONDITION of sub-command GENERATE must not be empty if specified.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2.cmake b/Tests/RunCMake/File_Generate/EmptyCondition2.cmake
new file mode 100644
index 000000000..626bfb4c4
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/EmptyCondition2.cmake
@@ -0,0 +1,5 @@
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ CONDITION ""
+)
diff --git a/Tests/RunCMake/File_Generate/OutputConflict-result.txt b/Tests/RunCMake/File_Generate/OutputConflict-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/OutputConflict-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt
new file mode 100644
index 000000000..dbd39de50
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error in CMakeLists.txt:
+ Evaluation file to be written multiple times for different configurations
+ with different content:
+
+ .*output.txt
diff --git a/Tests/RunCMake/File_Generate/OutputConflict.cmake b/Tests/RunCMake/File_Generate/OutputConflict.cmake
new file mode 100644
index 000000000..7f3e8c7c7
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/OutputConflict.cmake
@@ -0,0 +1,4 @@
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+)
diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
new file mode 100644
index 000000000..f07431c0e
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
@@ -0,0 +1,10 @@
+include(RunCMake)
+
+run_cmake(CommandConflict)
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio" OR "${RunCMake_GENERATOR}" MATCHES "XCode" )
+ run_cmake(OutputConflict)
+endif()
+run_cmake(EmptyCondition1)
+run_cmake(EmptyCondition2)
+run_cmake(BadCondition)
+run_cmake(DebugEvaluate)
diff --git a/Tests/RunCMake/File_Generate/input.txt b/Tests/RunCMake/File_Generate/input.txt
new file mode 100644
index 000000000..3db429d21
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/input.txt
@@ -0,0 +1 @@
+Some $<$<CONFIG:Debug>:conflicting> $<$<NOT:$<CONFIG:Debug>>:content>