cmake: Move Compiler flags to new file
[resolv_wrapper.git] / cmake / Modules / AddCMockaTest.cmake
1 # - ADD_CHECK_TEST(test_name test_source linklib1 ... linklibN)
2
3 # Copyright (c) 2007      Daniel Gollub <dgollub@suse.de>
4 # Copyright (c) 2007-2010 Andreas Schneider <asn@cynapses.org>
5 #
6 # Redistribution and use is allowed according to the terms of the BSD license.
7 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
8
9 enable_testing()
10 include(CTest)
11
12 function (ADD_CMOCKA_TEST _testName _testSource)
13     add_executable(${_testName} ${_testSource})
14     target_link_libraries(${_testName} ${ARGN})
15     add_test(${_testName} ${CMAKE_CURRENT_BINARY_DIR}/${_testName})
16 endfunction (ADD_CMOCKA_TEST)