summaryrefslogtreecommitdiff
path: root/Tests/CompileCommandOutput
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2011-03-31 16:55:00 -0700
committerBrad King <brad.king@kitware.com>2011-04-25 13:27:59 -0400
commit0e6b05fcba61a1b113b841dd2b3e1e5060866d0e (patch)
tree7c7a2237420f7c6692e7d9d752373d1ceb4ef7cb /Tests/CompileCommandOutput
parent5674844de4b74d0b66cfc6b8237e631702c43637 (diff)
downloadcmake-0e6b05fcba61a1b113b841dd2b3e1e5060866d0e.tar.gz
Adds a test for the compile command line output.
Diffstat (limited to 'Tests/CompileCommandOutput')
-rw-r--r--Tests/CompileCommandOutput/CMakeLists.txt11
-rw-r--r--Tests/CompileCommandOutput/compile_command_output.cxx9
-rw-r--r--Tests/CompileCommandOutput/file with spaces.cxx3
-rw-r--r--Tests/CompileCommandOutput/file with spaces.h1
-rw-r--r--Tests/CompileCommandOutput/relative.cxx3
-rw-r--r--Tests/CompileCommandOutput/relative.h1
6 files changed, 28 insertions, 0 deletions
diff --git a/Tests/CompileCommandOutput/CMakeLists.txt b/Tests/CompileCommandOutput/CMakeLists.txt
new file mode 100644
index 0000000000..ac39b8bb34
--- /dev/null
+++ b/Tests/CompileCommandOutput/CMakeLists.txt
@@ -0,0 +1,11 @@
+# a simple C only test case
+cmake_minimum_required (VERSION 2.6)
+project (CompileCommandOutput CXX)
+
+SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
+ADD_LIBRARY(test1 STATIC "file with spaces.cxx")
+ADD_LIBRARY(test2 SHARED "../CompileCommandOutput/relative.cxx")
+INCLUDE_DIRECTORIES(${CompileCommandOutput_SOURCE_DIR}/../../Source)
+ADD_EXECUTABLE(CompileCommandOutput compile_command_output.cxx)
+TARGET_LINK_LIBRARIES(CompileCommandOutput test1 test2)
diff --git a/Tests/CompileCommandOutput/compile_command_output.cxx b/Tests/CompileCommandOutput/compile_command_output.cxx
new file mode 100644
index 0000000000..9487c896cd
--- /dev/null
+++ b/Tests/CompileCommandOutput/compile_command_output.cxx
@@ -0,0 +1,9 @@
+#include "file with spaces.h"
+#include "relative.h"
+
+int main (int argc, char** argv)
+{
+ file_with_spaces();
+ relative();
+ return 0;
+}
diff --git a/Tests/CompileCommandOutput/file with spaces.cxx b/Tests/CompileCommandOutput/file with spaces.cxx
new file mode 100644
index 0000000000..5759319df1
--- /dev/null
+++ b/Tests/CompileCommandOutput/file with spaces.cxx
@@ -0,0 +1,3 @@
+#include "file with spaces.h"
+
+void file_with_spaces() {}
diff --git a/Tests/CompileCommandOutput/file with spaces.h b/Tests/CompileCommandOutput/file with spaces.h
new file mode 100644
index 0000000000..49b686c007
--- /dev/null
+++ b/Tests/CompileCommandOutput/file with spaces.h
@@ -0,0 +1 @@
+void file_with_spaces();
diff --git a/Tests/CompileCommandOutput/relative.cxx b/Tests/CompileCommandOutput/relative.cxx
new file mode 100644
index 0000000000..eae11e226e
--- /dev/null
+++ b/Tests/CompileCommandOutput/relative.cxx
@@ -0,0 +1,3 @@
+#include "relative.h"
+
+void relative() {}
diff --git a/Tests/CompileCommandOutput/relative.h b/Tests/CompileCommandOutput/relative.h
new file mode 100644
index 0000000000..2168035cc6
--- /dev/null
+++ b/Tests/CompileCommandOutput/relative.h
@@ -0,0 +1 @@
+void relative();