Statistics
| Branch: | Tag: | Revision:

root / host / tests / CMakeLists.txt @ 14244880

History | View | Annotate | Download (1.98 KB)

1
#
2
# Copyright 2010-2011 Ettus Research LLC
3
#
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
#
17

    
18
########################################################################
19
# unit test suite
20
########################################################################
21
SET(test_sources
22
    addr_test.cpp
23
    buffer_test.cpp
24
    byteswap_test.cpp
25
    convert_test.cpp
26
    dict_test.cpp
27
    error_test.cpp
28
    gain_group_test.cpp
29
    msg_test.cpp
30
    property_test.cpp
31
    ranges_test.cpp
32
    sph_recv_test.cpp
33
    sph_send_test.cpp
34
    subdev_spec_test.cpp
35
    time_spec_test.cpp
36
    vrt_test.cpp
37
)
38

    
39
#turn each test cpp file into an executable with an int main() function
40
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
41

    
42
#for each source: build an executable, register it as a test, and install
43
FOREACH(test_source ${test_sources})
44
    GET_FILENAME_COMPONENT(test_name ${test_source} NAME_WE)
45
    ADD_EXECUTABLE(${test_name} ${test_source})
46
    TARGET_LINK_LIBRARIES(${test_name} uhd)
47
    ADD_TEST(${test_name} ${test_name})
48
    INSTALL(TARGETS ${test_name} RUNTIME DESTINATION ${PKG_LIB_DIR}/tests COMPONENT tests)
49
ENDFOREACH(test_source)
50

    
51
########################################################################
52
# demo of a loadable module
53
########################################################################
54
IF(MSVC OR APPLE OR LINUX)
55
    ADD_LIBRARY(module_test MODULE module_test.cpp)
56
    TARGET_LINK_LIBRARIES(module_test uhd)
57
ENDIF()