|
1 | | -project(lsltests |
2 | | - VERSION 1.14.0 |
3 | | - LANGUAGES CXX |
4 | | - DESCRIPTION "Unit tests for liblsl" |
5 | | - ) |
6 | | -cmake_minimum_required (VERSION 3.12) |
7 | | -enable_testing() |
8 | | - |
9 | | -option(LSL_BENCHMARKS "Enable benchmarks in unit tests" OFF) |
10 | | - |
11 | | -add_library(catch_main OBJECT catch_main.cpp) |
12 | | -target_compile_features(catch_main PUBLIC cxx_std_11) |
13 | | - |
14 | | -target_compile_definitions(catch_main PRIVATE LSL_VERSION_INFO="${LSL_VERSION_INFO}") |
15 | | -if(LSL_BENCHMARKS) |
16 | | - target_compile_definitions(catch_main PUBLIC CATCH_CONFIG_ENABLE_BENCHMARKING) |
17 | | -endif() |
18 | | - |
19 | | -add_executable(lsl_test_exported |
20 | | - DataType.cpp |
21 | | - discovery.cpp |
22 | | - move.cpp |
23 | | - timesync.cpp |
24 | | -) |
25 | | -target_link_libraries(lsl_test_exported PRIVATE lsl catch_main) |
26 | | - |
27 | | -add_executable(lsl_test_internal |
28 | | - asiocancel.cpp |
29 | | - inireader.cpp |
30 | | - stringfuncs.cpp |
31 | | - streaminfo.cpp |
32 | | -) |
33 | | -target_link_libraries(lsl_test_internal PRIVATE lslobj lslboost catch_main) |
34 | | - |
35 | | -if(LSL_BENCHMARKS) |
36 | | - # to get somewhat reproducible performance numbers: |
37 | | - # /usr/bin/time -v testing/lsl_bench_exported --benchmark-samples 100 bounce |
38 | | - # [unix only] | binary | nr. of samples | test name |
39 | | - add_executable(lsl_bench_exported |
40 | | - bench_ext_bounce.cpp |
41 | | - bench_ext_common.cpp |
42 | | - ) |
43 | | - target_link_libraries(lsl_bench_exported PRIVATE lsl catch_main) |
44 | | - installLSLApp(lsl_bench_exported) |
45 | | - |
46 | | - add_executable(lsl_bench_internal |
47 | | - bench_int_sleep.cpp |
48 | | - ) |
49 | | - target_link_libraries(lsl_bench_internal PRIVATE lslobj lslboost catch_main) |
50 | | - installLSLApp(lsl_bench_internal) |
51 | | -endif() |
52 | | - |
53 | | -set(LSL_TESTS lsl_test_exported lsl_test_internal) |
54 | | -foreach(lsltest ${LSL_TESTS}) |
55 | | - add_test(NAME ${lsltest} COMMAND ${lsltest} --wait-for-keypress never) |
56 | | - installLSLApp(${lsltest}) |
57 | | -endforeach() |
58 | | - |
59 | | -installLSLAuxFiles(lsl_test_exported directory lslcfgs) |
| 1 | +project(lsltests |
| 2 | + VERSION 1.14.0 |
| 3 | + LANGUAGES CXX |
| 4 | + DESCRIPTION "Unit tests for liblsl" |
| 5 | + ) |
| 6 | +cmake_minimum_required (VERSION 3.12) |
| 7 | +enable_testing() |
| 8 | + |
| 9 | +option(LSL_BENCHMARKS "Enable benchmarks in unit tests" OFF) |
| 10 | + |
| 11 | +add_library(catch_main OBJECT catch_main.cpp) |
| 12 | +target_compile_features(catch_main PUBLIC cxx_std_11) |
| 13 | + |
| 14 | +target_compile_definitions(catch_main PRIVATE LSL_VERSION_INFO="${LSL_VERSION_INFO}") |
| 15 | +if(LSL_BENCHMARKS) |
| 16 | + target_compile_definitions(catch_main PUBLIC CATCH_CONFIG_ENABLE_BENCHMARKING) |
| 17 | +endif() |
| 18 | + |
| 19 | +add_executable(lsl_test_exported |
| 20 | + DataType.cpp |
| 21 | + discovery.cpp |
| 22 | + move.cpp |
| 23 | + timesync.cpp |
| 24 | +) |
| 25 | +target_link_libraries(lsl_test_exported PRIVATE lsl catch_main) |
| 26 | + |
| 27 | +find_package(Threads REQUIRED) |
| 28 | + |
| 29 | +add_executable(lsl_test_internal |
| 30 | + asiocancel.cpp |
| 31 | + inireader.cpp |
| 32 | + stringfuncs.cpp |
| 33 | + streaminfo.cpp |
| 34 | + test_int_samples.cpp |
| 35 | +) |
| 36 | +target_link_libraries(lsl_test_internal PRIVATE lslobj lslboost catch_main) |
| 37 | + |
| 38 | +if(LSL_BENCHMARKS) |
| 39 | + # to get somewhat reproducible performance numbers: |
| 40 | + # /usr/bin/time -v testing/lsl_bench_exported --benchmark-samples 100 bounce |
| 41 | + # [unix only] | binary | nr. of samples | test name |
| 42 | + add_executable(lsl_bench_exported |
| 43 | + bench_ext_bounce.cpp |
| 44 | + bench_ext_common.cpp |
| 45 | + bench_ext_pushpull.cpp |
| 46 | + ) |
| 47 | + target_link_libraries(lsl_bench_exported PRIVATE lsl catch_main Threads::Threads) |
| 48 | + installLSLApp(lsl_bench_exported) |
| 49 | + |
| 50 | + add_executable(lsl_bench_internal |
| 51 | + bench_int_sleep.cpp |
| 52 | + ) |
| 53 | + target_link_libraries(lsl_bench_internal PRIVATE lslobj lslboost catch_main) |
| 54 | + installLSLApp(lsl_bench_internal) |
| 55 | +endif() |
| 56 | + |
| 57 | +set(LSL_TESTS lsl_test_exported lsl_test_internal) |
| 58 | +foreach(lsltest ${LSL_TESTS}) |
| 59 | + add_test(NAME ${lsltest} COMMAND ${lsltest} --wait-for-keypress never) |
| 60 | + installLSLApp(${lsltest}) |
| 61 | +endforeach() |
| 62 | + |
| 63 | +installLSLAuxFiles(lsl_test_exported directory lslcfgs) |
0 commit comments