Dev: options for clang-tidy extended, fixed warning.
[marnav.git] / test / CMakeLists.txt
blobf6df969cfbbfa0c2bdd86be924092fc82bcba2df
2 include_directories(
3         ${CMAKE_CURRENT_SOURCE_DIR}
4         ${CMAKE_CURRENT_SOURCE_DIR}/../src
5         ${CMAKE_CURRENT_BINARY_DIR}/../src
6         )
8 set(SOURCES
9         # intentionally left blank
10         )
12 if(ENABLE_AIS)
13         set(SOURCES ${SOURCES}
14                 ais/Test_ais.cpp
15                 ais/Test_ais_angle.cpp
16                 ais/Test_ais_message.cpp
17                 ais/Test_ais_message_01.cpp
18                 ais/Test_ais_message_02.cpp
19                 ais/Test_ais_message_03.cpp
20                 ais/Test_ais_message_04.cpp
21                 ais/Test_ais_message_05.cpp
22                 ais/Test_ais_message_09.cpp
23                 ais/Test_ais_message_10.cpp
24                 ais/Test_ais_message_11.cpp
25                 ais/Test_ais_message_18.cpp
26                 ais/Test_ais_message_19.cpp
27                 ais/Test_ais_message_21.cpp
28                 ais/Test_ais_message_22.cpp
29                 ais/Test_ais_message_23.cpp
30                 ais/Test_ais_message_24.cpp
31         )
32 endif()
34 if(ENABLE_SEATALK)
35         set(SOURCES ${SOURCES}
36                 seatalk/Test_seatalk_message.cpp
37                 seatalk/Test_seatalk_message_00.cpp
38                 seatalk/Test_seatalk_message_01.cpp
39                 seatalk/Test_seatalk_message_05.cpp
40                 seatalk/Test_seatalk_message_10.cpp
41                 seatalk/Test_seatalk_message_11.cpp
42                 seatalk/Test_seatalk_message_20.cpp
43                 seatalk/Test_seatalk_message_21.cpp
44                 seatalk/Test_seatalk_message_22.cpp
45                 seatalk/Test_seatalk_message_23.cpp
46                 seatalk/Test_seatalk_message_24.cpp
47                 seatalk/Test_seatalk_message_25.cpp
48                 seatalk/Test_seatalk_message_26.cpp
49                 seatalk/Test_seatalk_message_27.cpp
50                 seatalk/Test_seatalk_message_30.cpp
51                 seatalk/Test_seatalk_message_36.cpp
52                 seatalk/Test_seatalk_message_38.cpp
53                 seatalk/Test_seatalk_message_50.cpp
54                 seatalk/Test_seatalk_message_51.cpp
55                 seatalk/Test_seatalk_message_52.cpp
56                 seatalk/Test_seatalk_message_53.cpp
57                 seatalk/Test_seatalk_message_54.cpp
58                 seatalk/Test_seatalk_message_56.cpp
59                 seatalk/Test_seatalk_message_58.cpp
60                 seatalk/Test_seatalk_message_59.cpp
61                 seatalk/Test_seatalk_message_65.cpp
62                 seatalk/Test_seatalk_message_66.cpp
63                 seatalk/Test_seatalk_message_6c.cpp
64                 seatalk/Test_seatalk_message_86.cpp
65                 seatalk/Test_seatalk_message_87.cpp
66                 seatalk/Test_seatalk_message_89.cpp
67                 )
68 endif()
70 if(ENABLE_IO)
71         set(SOURCES ${SOURCES}
72                 io/Test_io_nmea_reader.cpp
73                 )
74         if(ENABLE_SEATALK)
75                 set(SOURCES ${SOURCES}
76                         io/Test_io_seatalk_reader.cpp
77                         )
78         endif()
79 endif()
81 add_executable(testrunner
82         utils/Test_utils_bitset.cpp
83         utils/Test_utils_mmsi.cpp
84         utils/Test_utils_optional.cpp
85         math/Test_math_floatingpoint.cpp
86         math/Test_math_vector.cpp
87         math/Test_math_matrix.cpp
88         math/Test_math_quaternion.cpp
89         geo/Test_geo_angle.cpp
90         geo/Test_geo_region.cpp
91         geo/Test_geo_cpa.cpp
92         geo/Test_geo_geodesic.cpp
93         nmea/Test_nmea_waypoint.cpp
94         nmea/Test_nmea_checksum.cpp
95         nmea/Test_nmea_split.cpp
96         nmea/Test_nmea.cpp
97         nmea/Test_nmea_angle.cpp
98         nmea/Test_nmea_date.cpp
99         nmea/Test_nmea_time.cpp
100         nmea/Test_nmea_duration.cpp
101         nmea/Test_nmea_sentence.cpp
102         nmea/Test_nmea_manufacturer.cpp
103         nmea/Test_nmea_io.cpp
104         nmea/Test_nmea_aam.cpp
105         nmea/Test_nmea_alm.cpp
106         nmea/Test_nmea_apa.cpp
107         nmea/Test_nmea_apb.cpp
108         nmea/Test_nmea_bod.cpp
109         nmea/Test_nmea_bwc.cpp
110         nmea/Test_nmea_bwr.cpp
111         nmea/Test_nmea_bww.cpp
112         nmea/Test_nmea_dbk.cpp
113         nmea/Test_nmea_dbt.cpp
114         nmea/Test_nmea_dpt.cpp
115         nmea/Test_nmea_dsc.cpp
116         nmea/Test_nmea_dse.cpp
117         nmea/Test_nmea_dtm.cpp
118         nmea/Test_nmea_fsi.cpp
119         nmea/Test_nmea_gbs.cpp
120         nmea/Test_nmea_gga.cpp
121         nmea/Test_nmea_glc.cpp
122         nmea/Test_nmea_gll.cpp
123         nmea/Test_nmea_gns.cpp
124         nmea/Test_nmea_grs.cpp
125         nmea/Test_nmea_gsa.cpp
126         nmea/Test_nmea_gst.cpp
127         nmea/Test_nmea_gsv.cpp
128         nmea/Test_nmea_gtd.cpp
129         nmea/Test_nmea_hdg.cpp
130         nmea/Test_nmea_hfb.cpp
131         nmea/Test_nmea_hdm.cpp
132         nmea/Test_nmea_hsc.cpp
133         nmea/Test_nmea_its.cpp
134         nmea/Test_nmea_lcd.cpp
135         nmea/Test_nmea_msk.cpp
136         nmea/Test_nmea_mss.cpp
137         nmea/Test_nmea_mtw.cpp
138         nmea/Test_nmea_mwd.cpp
139         nmea/Test_nmea_mwv.cpp
140         nmea/Test_nmea_osd.cpp
141         nmea/Test_nmea_r00.cpp
142         nmea/Test_nmea_rma.cpp
143         nmea/Test_nmea_rmb.cpp
144         nmea/Test_nmea_rmc.cpp
145         nmea/Test_nmea_rot.cpp
146         nmea/Test_nmea_rpm.cpp
147         nmea/Test_nmea_rsa.cpp
148         nmea/Test_nmea_rsd.cpp
149         nmea/Test_nmea_rte.cpp
150         nmea/Test_nmea_sfi.cpp
151         nmea/Test_nmea_tds.cpp
152         nmea/Test_nmea_tfi.cpp
153         nmea/Test_nmea_tll.cpp
154         nmea/Test_nmea_tpc.cpp
155         nmea/Test_nmea_tpr.cpp
156         nmea/Test_nmea_tpt.cpp
157         nmea/Test_nmea_ttm.cpp
158         nmea/Test_nmea_vbw.cpp
159         nmea/Test_nmea_vdm.cpp
160         nmea/Test_nmea_vdo.cpp
161         nmea/Test_nmea_vdr.cpp
162         nmea/Test_nmea_vhw.cpp
163         nmea/Test_nmea_vlw.cpp
164         nmea/Test_nmea_vpw.cpp
165         nmea/Test_nmea_vwr.cpp
166         nmea/Test_nmea_vtg.cpp
167         nmea/Test_nmea_wcv.cpp
168         nmea/Test_nmea_wnc.cpp
169         nmea/Test_nmea_wpl.cpp
170         nmea/Test_nmea_xdr.cpp
171         nmea/Test_nmea_xte.cpp
172         nmea/Test_nmea_xtr.cpp
173         nmea/Test_nmea_zda.cpp
174         nmea/Test_nmea_zdl.cpp
175         nmea/Test_nmea_zfo.cpp
176         nmea/Test_nmea_ztg.cpp
177         nmea/Test_nmea_pgrme.cpp
178         nmea/Test_nmea_pgrmm.cpp
179         nmea/Test_nmea_pgrmz.cpp
180         ${SOURCES}
181         )
183 target_link_libraries(testrunner
184         marnav
185         gmock
186         pthread
187         )
189 add_test(
190         NAME unittest-testrunner
191         COMMAND testrunner
192         WORKING_DIRECTOR "${CMAKE_CURRENT_BINARY_DIR}"
193         )
194 run_unittest(testrunner)
196 if(ENABLE_AIS)
197         execute_process(
198                 COMMAND ${CMAKE_COMMAND} -E tar xzf "${CMAKE_CURRENT_SOURCE_DIR}/ais/ais-sample.tar.gz"
199                 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
200                 )
202         add_executable(test-ais-sample
203                 test-ais-sample.cpp
204                 )
206         target_link_libraries(test-ais-sample
207                 marnav
208                 )
210         add_test(
211                 NAME integrationtest-test-ais-sample
212                 COMMAND test-ais-sample
213                 WORKING_DIRECTOR "${CMAKE_CURRENT_BINARY_DIR}"
214                 )
215 endif()
217 execute_process(
218         COMMAND ${CMAKE_COMMAND} -E tar xzf "${CMAKE_CURRENT_SOURCE_DIR}/nmea/nmea-sample.tar.gz"
219         WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
220         )
222 add_executable(test-nmea-sample
223         test-nmea-sample.cpp
224         )
226 target_link_libraries(test-nmea-sample
227         marnav
228         )
230 add_test(
231         NAME integrationtest-test-nmea-sample
232         COMMAND test-nmea-sample
233         WORKING_DIRECTOR "${CMAKE_CURRENT_BINARY_DIR}"
234         )
236 # excluded with coverage builds, does not make sense otherwise
237 if(NOT build_type_lower MATCHES coverage)
238         add_executable(benchmark_nmea_split
239                 nmea/Benchmark_nmea_split.cpp
240                 )
242         target_link_libraries(benchmark_nmea_split
243                 marnav
244                 benchmark
245                 pthread
246                 )
248         add_executable(benchmark_nmea_checksum
249                 nmea/Benchmark_nmea_checksum.cpp
250                 )
252         target_link_libraries(benchmark_nmea_checksum
253                 marnav
254                 benchmark
255                 pthread
256                 )
258         add_executable(benchmark_nmea_manufacturer
259                 nmea/Benchmark_nmea_manufacturer.cpp
260                 )
262         target_link_libraries(benchmark_nmea_manufacturer
263                 marnav
264                 benchmark
265                 pthread
266                 )
268         add_executable(benchmark_nmea_sentence
269                 nmea/Benchmark_nmea_sentence.cpp
270                 )
272         target_link_libraries(benchmark_nmea_sentence
273                 marnav
274                 benchmark
275                 pthread
276                 )
278         if(ENABLE_AIS)
279                 add_executable(benchmark_ais_message
280                         ais/Benchmark_ais_message.cpp
281                         )
283                 target_link_libraries(benchmark_ais_message
284                         marnav
285                         benchmark
286                         pthread
287                         )
288         endif()
289 endif()