aboutsummaryrefslogtreecommitdiffstats
path: root/host/test/CMakeLists.txt
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-10-20 20:00:09 -0400
committerPhilip Balister <philip@opensdr.com>2010-10-20 20:00:09 -0400
commit635440c5990e7a27fdb38f694123258633e85427 (patch)
tree603ff2312dd612ea7759432f51ffb7a6c7db3448 /host/test/CMakeLists.txt
parent6b203950d9583ab882628311402e26cf40838aa0 (diff)
parente0c48ba5cc1033cd330e2ce73ceb03740923e954 (diff)
downloaduhd-635440c5990e7a27fdb38f694123258633e85427.tar.gz
uhd-635440c5990e7a27fdb38f694123258633e85427.tar.bz2
uhd-635440c5990e7a27fdb38f694123258633e85427.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e_mmap_b2
Diffstat (limited to 'host/test/CMakeLists.txt')
-rw-r--r--host/test/CMakeLists.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/host/test/CMakeLists.txt b/host/test/CMakeLists.txt
index 0d4607f68..59a550f98 100644
--- a/host/test/CMakeLists.txt
+++ b/host/test/CMakeLists.txt
@@ -18,8 +18,7 @@
########################################################################
# unit test suite
########################################################################
-ADD_EXECUTABLE(main_test
- main_test.cpp
+SET(test_sources
addr_test.cpp
buffer_test.cpp
byteswap_test.cpp
@@ -28,13 +27,24 @@ ADD_EXECUTABLE(main_test
error_test.cpp
gain_group_test.cpp
subdev_spec_test.cpp
+ time_spec_test.cpp
tune_helper_test.cpp
vrt_test.cpp
warning_test.cpp
wax_test.cpp
)
-TARGET_LINK_LIBRARIES(main_test uhd)
-ADD_TEST(test main_test)
+
+#turn each test cpp file into an executable with an int main() function
+ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
+
+#for each source: build an executable, register it as a test, and install
+FOREACH(test_source ${test_sources})
+ GET_FILENAME_COMPONENT(test_name ${test_source} NAME_WE)
+ ADD_EXECUTABLE(${test_name} ${test_source})
+ TARGET_LINK_LIBRARIES(${test_name} uhd)
+ ADD_TEST(${test_name} ${test_name})
+ INSTALL(TARGETS ${test_name} RUNTIME DESTINATION ${PKG_DATA_DIR}/tests)
+ENDFOREACH(test_source)
########################################################################
# demo of a loadable module