aboutsummaryrefslogtreecommitdiff
path: root/sensor/test/CMakeLists.txt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-03-23 00:14:56 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-03-23 00:14:56 +0100
commitf110a0912efb7245d6d548aa8a5ac0c89bcd9dc0 (patch)
tree5e9be9b2b2eda5082089a42570c5b88b65647f8b /sensor/test/CMakeLists.txt
parent52d0fe67f8998b215a47ebc697600cae49a7b17a (diff)
downloadble-toys-f110a0912efb7245d6d548aa8a5ac0c89bcd9dc0.tar.gz
ble-toys-f110a0912efb7245d6d548aa8a5ac0c89bcd9dc0.tar.bz2
ble-toys-f110a0912efb7245d6d548aa8a5ac0c89bcd9dc0.tar.xz
ble-toys-f110a0912efb7245d6d548aa8a5ac0c89bcd9dc0.zip
o Replacing regex based parsing with simpler and more correct tokenizing.
o Flushing output after each sample. o Adding back tests.
Diffstat (limited to 'sensor/test/CMakeLists.txt')
-rw-r--r--sensor/test/CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/sensor/test/CMakeLists.txt b/sensor/test/CMakeLists.txt
new file mode 100644
index 0000000..2e68532
--- /dev/null
+++ b/sensor/test/CMakeLists.txt
@@ -0,0 +1,26 @@
+find_package(Boost COMPONENTS log regex unit_test_framework REQUIRED)
+
+# If we can change directory here add_definition and test-specific stuff could be moved to the test directory
+file(GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *Test.cpp)
+add_definitions(-DBOOST_TEST_DYN_LINK)
+
+foreach(testSrc ${TEST_SRCS})
+ get_filename_component(testName ${testSrc} NAME_WE)
+
+ #Add compile target
+ add_executable(${testName} ${testSrc})
+
+ include_directories(../include)
+
+ target_link_libraries(${testName} trygvis-sensor)
+ target_link_libraries(${testName} ${Boost_LIBRARIES})
+
+# set_target_properties(${testName} PROPERTIES
+# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test)
+
+ #Finally add it to test execution -
+ #Notice the WORKING_DIRECTORY and COMMAND
+ add_test(NAME ${testName}
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testBin
+ COMMAND ${CMAKE_BINARY_DIR}/testBin/${testName})
+endforeach(testSrc)