aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/MacroAddCheckTest.cmake
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2010-10-21 19:02:02 +0000
committerEd Schouten <ed@FreeBSD.org>2010-10-21 19:02:02 +0000
commit217b614317dad692116a3a06fe94ea8f61a59edb (patch)
tree4cfe2eee875a959effca0881df14c079103447fa /cmake/Modules/MacroAddCheckTest.cmake
downloadsrc-217b614317dad692116a3a06fe94ea8f61a59edb.tar.gz
src-217b614317dad692116a3a06fe94ea8f61a59edb.zip
Import compiler-rt r117047.vendor/compiler-rt/compiler-rt-r117047
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=214152 svn path=/vendor/compiler-rt/compiler-rt-r117047/; revision=214153; tag=vendor/compiler-rt/compiler-rt-r117047
Diffstat (limited to 'cmake/Modules/MacroAddCheckTest.cmake')
-rw-r--r--cmake/Modules/MacroAddCheckTest.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/Modules/MacroAddCheckTest.cmake b/cmake/Modules/MacroAddCheckTest.cmake
new file mode 100644
index 000000000000..a13912188716
--- /dev/null
+++ b/cmake/Modules/MacroAddCheckTest.cmake
@@ -0,0 +1,12 @@
+# - macro_add_check_test(test_name test_source linklib1 ... linklibN)
+
+ENABLE_TESTING()
+include(CTest)
+set(CMAKE_C_FLAGS_PROFILING "-g -pg")
+
+macro (MACRO_ADD_CHECK_TEST _testName _testSource)
+ add_executable(${_testName} ${_testSource})
+ target_link_libraries(${_testName} ${ARGN})
+ get_target_property(_targetLocation ${_testName} LOCATION)
+ add_test(${_testName} ${_targetLocation})
+endmacro (MACRO_ADD_CHECK_TEST)