summaryrefslogtreecommitdiff
path: root/tests/compilation/CompilationTests_CMakeLists.txt
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2010-12-07 18:47:05 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2010-12-11 12:18:50 +0200
commitc4894eaf45765137ec46d552cb4628bf58289191 (patch)
treea413a0f0a734c721da903b4c747446df61a0bba8 /tests/compilation/CompilationTests_CMakeLists.txt
parent5a36eaf266192b85dd1da5caaa31cf7ba2529b18 (diff)
Implement a system for doing compilation tests.
Compilation tests are basically to test if a certain piece of code compiles or not. This is useful for ensuring that certain uses of our templates will NOT compile and thus prevent the users from misusing them by mistake.
Diffstat (limited to 'tests/compilation/CompilationTests_CMakeLists.txt')
-rw-r--r--tests/compilation/CompilationTests_CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/compilation/CompilationTests_CMakeLists.txt b/tests/compilation/CompilationTests_CMakeLists.txt
new file mode 100644
index 0000000..fe58e5f
--- /dev/null
+++ b/tests/compilation/CompilationTests_CMakeLists.txt
@@ -0,0 +1,17 @@
+# This is a cmake project file that is used to run the compilation tests.
+# We misuse cmake here by running tests with the try_compile command and basing
+# the result of the whole test suite on the cmake exit status.
+
+cmake_minimum_required(VERSION 2.8)
+find_package(QtGstreamer REQUIRED)
+include(MacroCXXCompilationTest)
+
+set(CMAKE_REQUIRED_LIBRARIES ${QTGSTREAMER_LIBRARIES})
+set(CMAKE_REQUIRED_INCLUDES ${QTGSTREAMER_INCLUDES})
+set(CMAKE_REQUIRED_DEFINITIONS ${QTGSTREAMER_DEFINITIONS})
+set(CMAKE_REQUIRED_FLAGS "${QTGSTREAMER_FLAGS}")
+
+message("********* Begin running compilation tests *********")
+include(CompilationTests.cmake)
+evaluate_cxx_compilation_test_results()
+message("********* Finished running compilation tests *********")