From cd05791ac1f8a844517add54f005d019b201ebcd Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 19 Oct 2010 01:21:34 -0700 Subject: uhd: made ticks signed in time spec, fixed full secs implementation, added unit tests --- host/test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'host/test/CMakeLists.txt') diff --git a/host/test/CMakeLists.txt b/host/test/CMakeLists.txt index c620fd641..fb075ea07 100644 --- a/host/test/CMakeLists.txt +++ b/host/test/CMakeLists.txt @@ -28,6 +28,7 @@ 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 -- cgit v1.2.3 From 561bb73ee3fca52e6d711de1030f027b30fcefaa Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 19 Oct 2010 10:37:00 -0700 Subject: uhd: split unit tests into individual tests by file + they get installed --- host/test/CMakeLists.txt | 17 +++++++++++++---- host/test/main_test.cpp | 3 --- 2 files changed, 13 insertions(+), 7 deletions(-) delete mode 100644 host/test/main_test.cpp (limited to 'host/test/CMakeLists.txt') diff --git a/host/test/CMakeLists.txt b/host/test/CMakeLists.txt index fb075ea07..d67399e5b 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 @@ -34,8 +33,18 @@ ADD_EXECUTABLE(main_test 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 diff --git a/host/test/main_test.cpp b/host/test/main_test.cpp deleted file mode 100644 index 0b47303b7..000000000 --- a/host/test/main_test.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MAIN -#include -- cgit v1.2.3