summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CompileDefinitions
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-21 20:52:44 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-22 19:23:49 (GMT)
commitc1bf1a59ffe983086b30aee3e0299b80f9c8a817 (patch)
tree269904cb3b0d91ed94fdc7004ecc5623000c6379 /Tests/RunCMake/CompileDefinitions
parent8d336875b3cea99e5c458d3e299d8caf8bc84b75 (diff)
downloadCMake-c1bf1a59ffe983086b30aee3e0299b80f9c8a817.zip
CMake-c1bf1a59ffe983086b30aee3e0299b80f9c8a817.tar.gz
CMake-c1bf1a59ffe983086b30aee3e0299b80f9c8a817.tar.bz2
CompileDefinitions: Add unit test for setting empty content.
Diffstat (limited to 'Tests/RunCMake/CompileDefinitions')
-rw-r--r--Tests/RunCMake/CompileDefinitions/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt1
-rw-r--r--Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt3
-rw-r--r--Tests/RunCMake/CompileDefinitions/SetEmpty.cmake12
5 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/CompileDefinitions/CMakeLists.txt b/Tests/RunCMake/CompileDefinitions/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake b/Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake
new file mode 100644
index 0000000..233fe34
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(SetEmpty)
diff --git a/Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt b/Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt b/Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt
new file mode 100644
index 0000000..ace6656
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt
@@ -0,0 +1,3 @@
+RESULT1=A;;B
+RESULT2=
+RESULT3=-DBAR
diff --git a/Tests/RunCMake/CompileDefinitions/SetEmpty.cmake b/Tests/RunCMake/CompileDefinitions/SetEmpty.cmake
new file mode 100644
index 0000000..15cb4e9
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/SetEmpty.cmake
@@ -0,0 +1,12 @@
+
+set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS A "" B)
+get_property(result DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+message("RESULT1=${result}")
+
+set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+get_property(result DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+message("RESULT2=${result}")
+
+set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS -DBAR)
+get_property(result DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+message("RESULT3=${result}")