blob: 8e911de017208181d5d42580149c8d8892d901b5 [file] [log] [blame]
Brian Silverman100534c2015-09-07 15:51:23 -04001package(default_visibility = ['//visibility:public'])
2
3load('/aos/build/queues', 'queue_library')
4
5queue_library(
Austin Schuhf0736512015-09-07 01:22:16 -07006 name = 'test_queue',
7 srcs = [
8 'test_queue.q',
9 ],
10)
Austin Schuhf0736512015-09-07 01:22:16 -070011
12cc_library(
Austin Schuh044e18b2015-10-21 20:17:09 -070013 name = 'math',
14 hdrs = [
15 'commonmath.h',
16 ],
17)
18
19cc_library(
Austin Schuhf0736512015-09-07 01:22:16 -070020 name = 'queue_testutils',
21 srcs = [
22 'queue_testutils.cc',
23 ],
Brian Silverman100534c2015-09-07 15:51:23 -040024 hdrs = [
25 'queue_testutils.h',
26 ],
Austin Schuhf0736512015-09-07 01:22:16 -070027 deps = [
Austin Schuh044e18b2015-10-21 20:17:09 -070028 ':once',
29 ':queues',
Brian Silverman258b9172015-09-19 14:32:57 -040030 '//aos/testing:googletest',
Brian Silvermancb5da1f2015-12-05 22:19:58 -050031 '//aos/common/logging:implementations',
Austin Schuhf0736512015-09-07 01:22:16 -070032 '//aos/linux_code/ipc_lib:shared_mem',
Brian Silverman2200b2c2015-11-29 05:59:28 +000033 ':mutex',
Austin Schuhf0736512015-09-07 01:22:16 -070034 ],
35)
36
37cc_library(
Austin Schuh044e18b2015-10-21 20:17:09 -070038 name = 'macros',
39 hdrs = [
40 'macros.h',
41 ],
42)
43
44cc_library(
45 name = 'type_traits',
46 hdrs = [
47 'type_traits.h',
48 ],
49)
50
51cc_library(
Austin Schuhf0736512015-09-07 01:22:16 -070052 name = 'time',
Austin Schuhf0736512015-09-07 01:22:16 -070053 srcs = [
54 'time.cc',
55 ],
Brian Silverman100534c2015-09-07 15:51:23 -040056 hdrs = [
57 'time.h',
58 ],
Austin Schuhf0736512015-09-07 01:22:16 -070059 deps = [
Brian Silvermancb5da1f2015-12-05 22:19:58 -050060 '//aos/common/logging:logging',
Brian Silverman2200b2c2015-11-29 05:59:28 +000061 ':mutex',
Austin Schuh044e18b2015-10-21 20:17:09 -070062 ':macros',
63 '//aos/linux_code/ipc_lib:shared_mem',
Austin Schuhf0736512015-09-07 01:22:16 -070064 ],
65)
66
Brian Silvermanf480a612015-09-13 02:22:01 -040067genrule(
68 name = 'gen_queue_primitives',
69 visibility = ['//visibility:private'],
70 tools = ['//aos/build/queues:queue_primitives'],
71 outs = ['queue_primitives.h'],
72 cmd = '$(location //aos/build/queues:queue_primitives) $@',
73)
74
75genrule(
76 name = 'gen_print_field',
77 visibility = ['//visibility:private'],
78 tools = ['//aos/build/queues:print_field'],
79 outs = ['print_field.cc'],
80 cmd = '$(location //aos/build/queues:print_field) $@',
81)
82
Austin Schuhf0736512015-09-07 01:22:16 -070083cc_library(
Brian Silverman258b9172015-09-19 14:32:57 -040084 name = 'generated_queue_headers',
85 visibility = ['//aos/common/logging:__pkg__'],
86 hdrs = [
87 ':gen_queue_primitives',
88 ],
89)
90
91cc_library(
Brian Silverman2200b2c2015-11-29 05:59:28 +000092 name = 'event',
Austin Schuh044e18b2015-10-21 20:17:09 -070093 hdrs = [
94 'event.h',
95 ],
Brian Silverman2200b2c2015-11-29 05:59:28 +000096 srcs = [
97 'event.cc',
98 ],
Austin Schuh044e18b2015-10-21 20:17:09 -070099 deps = [
100 '//aos/linux_code/ipc_lib:aos_sync',
Brian Silverman30608942015-04-08 19:16:46 -0400101 ':time',
Brian Silvermancb5da1f2015-12-05 22:19:58 -0500102 '//aos/common/logging:logging',
Brian Silverman086cb8c2015-10-26 11:39:40 -0400103 ],
104)
105
106cc_library(
Austin Schuh044e18b2015-10-21 20:17:09 -0700107 name = 'unique_malloc_ptr',
108 hdrs = [
109 'unique_malloc_ptr.h',
110 ],
111)
112
113cc_library(
Austin Schuhf0736512015-09-07 01:22:16 -0700114 name = 'queue_types',
115 srcs = [
116 'queue_types.cc',
Brian Silvermanf480a612015-09-13 02:22:01 -0400117 ':gen_print_field',
Austin Schuh044e18b2015-10-21 20:17:09 -0700118 'print_field_helpers.h',
Austin Schuhf0736512015-09-07 01:22:16 -0700119 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400120 hdrs = [
121 'queue_types.h',
122 ],
123 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400124 ':generated_queue_headers',
Brian Silverman100534c2015-09-07 15:51:23 -0400125 '//aos/linux_code/ipc_lib:shared_mem',
126 '//aos/linux_code/ipc_lib:core_lib',
Brian Silverman2200b2c2015-11-29 05:59:28 +0000127 ':mutex',
Brian Silvermancb5da1f2015-12-05 22:19:58 -0500128 '//aos/common/logging:printf_formats',
Brian Silverman100534c2015-09-07 15:51:23 -0400129 ':time',
Austin Schuh044e18b2015-10-21 20:17:09 -0700130 ':byteorder'
Brian Silverman100534c2015-09-07 15:51:23 -0400131 ],
132)
133
134cc_test(
135 name = 'queue_types_test',
136 srcs = [
137 'queue_types_test.cc',
138 ],
139 deps = [
140 ':queue_types',
Brian Silverman258b9172015-09-19 14:32:57 -0400141 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400142 ':test_queue',
143 '//aos/common/logging',
144 ':queue_testutils',
145 ],
146)
147
148cc_library(
Austin Schuh044e18b2015-10-21 20:17:09 -0700149 name = 'network_port',
150 hdrs = [
151 'network_port.h',
152 ],
153)
154
155cc_library(
156 name = 'byteorder',
157 hdrs = [
158 'byteorder.h',
159 ],
160)
161
162cc_library(
Brian Silverman100534c2015-09-07 15:51:23 -0400163 name = 'queues',
164 srcs = [
165 'queue.cc',
166 ],
167 hdrs = [
168 'queue.h',
169 ],
170 deps = [
171 '//aos/linux_code/ipc_lib:queue',
172 ':time',
Austin Schuh044e18b2015-10-21 20:17:09 -0700173 ':macros',
174 '//aos/linux_code:queue',
175 ':byteorder',
Brian Silverman100534c2015-09-07 15:51:23 -0400176 ],
177)
178
179cc_library(
180 name = 'scoped_fd',
Austin Schuh044e18b2015-10-21 20:17:09 -0700181 hdrs = [
182 'scoped_fd.h',
183 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400184 deps = [
185 '//aos/common/logging',
186 ],
187)
188
189cc_test(
190 name = 'queue_test',
191 srcs = [
192 'queue_test.cc',
193 ],
194 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400195 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400196 ':queue_testutils',
197 ':test_queue',
198 '//aos/common/util:thread',
199 ':die',
200 ],
201)
202
203cc_test(
204 name = 'type_traits_test',
205 srcs = [
206 'type_traits_test.cpp',
207 ],
208 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400209 '//aos/testing:googletest',
Austin Schuh044e18b2015-10-21 20:17:09 -0700210 ':type_traits',
Brian Silverman100534c2015-09-07 15:51:23 -0400211 ],
212)
213
214cc_library(
215 name = 'gtest_prod',
Austin Schuh044e18b2015-10-21 20:17:09 -0700216 hdrs = [
217 'gtest_prod.h',
218 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400219)
220
221cc_library(
222 name = 'once',
Austin Schuh044e18b2015-10-21 20:17:09 -0700223 hdrs = [
224 'once.h',
225 ],
226 srcs = [
227 'once-tmpl.h',
228 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400229 deps = [
Brian Silvermanea542292015-09-13 02:24:45 -0400230 ':gtest_prod',
Austin Schuh044e18b2015-10-21 20:17:09 -0700231 ':type_traits',
Brian Silverman100534c2015-09-07 15:51:23 -0400232 ],
233)
234
235cc_test(
236 name = 'once_test',
237 srcs = [
238 'once_test.cc',
239 ],
240 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400241 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400242 ':once',
243 ],
244)
245
246cc_test(
247 name = 'time_test',
248 srcs = [
249 'time_test.cc',
250 ],
251 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400252 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400253 ':time',
254 '//aos/common/logging',
255 '//aos/common/util:death_test_log_implementation',
256 ],
257)
258
259cc_library(
260 name = 'die',
261 srcs = [
262 'die.cc',
263 ],
264 hdrs = [
265 'die.h',
266 ],
267 deps = [
Austin Schuh044e18b2015-10-21 20:17:09 -0700268 ':macros',
Brian Silverman100534c2015-09-07 15:51:23 -0400269 '//aos/common/libc:aos_strerror',
270 ],
271)
272
273cc_test(
274 name = 'queue_testutils_test',
275 srcs = [
276 'queue_testutils_test.cc',
277 ],
278 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400279 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400280 ':queue_testutils',
281 '//aos/common/logging',
282 ],
283)
284
285cc_test(
286 name = 'mutex_test',
287 srcs = [
288 'mutex_test.cc',
289 ],
290 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400291 '//aos/testing:googletest',
Brian Silverman2200b2c2015-11-29 05:59:28 +0000292 ':mutex',
Brian Silverman100534c2015-09-07 15:51:23 -0400293 ':die',
294 '//aos/common/logging',
295 '//aos/common/util:death_test_log_implementation',
296 '//aos/common/util:thread',
297 '//aos/common:time',
298 ':queue_testutils',
299 ],
300)
301
302cc_test(
303 name = 'event_test',
304 srcs = [
305 'event_test.cc',
306 ],
307 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400308 '//aos/testing:googletest',
Brian Silverman086cb8c2015-10-26 11:39:40 -0400309 ':event',
Brian Silverman100534c2015-09-07 15:51:23 -0400310 ':queue_testutils',
311 ':time',
312 ],
313)
314
Austin Schuh044e18b2015-10-21 20:17:09 -0700315cc_library(
Brian Silverman2200b2c2015-11-29 05:59:28 +0000316 name = 'condition',
Austin Schuh044e18b2015-10-21 20:17:09 -0700317 hdrs = [
318 'condition.h',
319 ],
Brian Silverman2200b2c2015-11-29 05:59:28 +0000320 srcs = [
321 'condition.cc',
322 ],
Brian Silverman086cb8c2015-10-26 11:39:40 -0400323 deps = [
Brian Silverman2200b2c2015-11-29 05:59:28 +0000324 ':mutex',
325 '//aos/linux_code/ipc_lib:aos_sync',
Brian Silvermancb5da1f2015-12-05 22:19:58 -0500326 '//aos/common/logging:logging',
Brian Silverman086cb8c2015-10-26 11:39:40 -0400327 ],
328)
329
Brian Silverman100534c2015-09-07 15:51:23 -0400330cc_test(
331 name = 'condition_test',
332 srcs = [
333 'condition_test.cc',
334 ],
335 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400336 '//aos/testing:googletest',
Brian Silverman086cb8c2015-10-26 11:39:40 -0400337 ':condition',
Brian Silverman100534c2015-09-07 15:51:23 -0400338 '//aos/common/util:thread',
339 ':time',
Brian Silverman2200b2c2015-11-29 05:59:28 +0000340 ':mutex',
Brian Silverman100534c2015-09-07 15:51:23 -0400341 '//aos/common/logging',
342 ':queue_testutils',
343 '//aos/linux_code/ipc_lib:core_lib',
344 '//aos/linux_code/ipc_lib:aos_sync',
345 ':die',
Brian Silverman100534c2015-09-07 15:51:23 -0400346 ],
347)
348
349cc_test(
350 name = 'die_test',
351 srcs = [
352 'die_test.cc',
353 ],
354 deps = [
Brian Silverman258b9172015-09-19 14:32:57 -0400355 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400356 ':die',
357 ],
358)
359
360cc_library(
361 name = 'stl_mutex',
Austin Schuh044e18b2015-10-21 20:17:09 -0700362 hdrs = [
363 'stl_mutex.h',
364 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400365 deps = [
366 '//aos/linux_code/ipc_lib:aos_sync',
367 '//aos/common/logging',
368 ],
369)
370
Austin Schuh044e18b2015-10-21 20:17:09 -0700371cc_library(
372 name = 'mutex',
373 hdrs = [
374 'mutex.h',
375 ],
Brian Silverman2200b2c2015-11-29 05:59:28 +0000376 srcs = [
377 'mutex.cc',
378 ],
Austin Schuh044e18b2015-10-21 20:17:09 -0700379 deps = [
380 '//aos/linux_code/ipc_lib:aos_sync',
381 ':die',
Brian Silvermancb5da1f2015-12-05 22:19:58 -0500382 '//aos/common/logging:logging',
Brian Silverman2200b2c2015-11-29 05:59:28 +0000383 ':type_traits',
Austin Schuh044e18b2015-10-21 20:17:09 -0700384 ],
385)
386
Brian Silverman100534c2015-09-07 15:51:23 -0400387cc_test(
388 name = 'stl_mutex_test',
389 srcs = [
390 'stl_mutex_test.cc',
391 ],
392 deps = [
393 ':stl_mutex',
Brian Silverman258b9172015-09-19 14:32:57 -0400394 '//aos/testing:googletest',
Brian Silverman100534c2015-09-07 15:51:23 -0400395 ':queue_testutils',
396 '//aos/common/util:thread',
397 ':die',
398 ],
Austin Schuhf0736512015-09-07 01:22:16 -0700399)
Brian Silverman3d37a5f2014-09-05 18:42:20 -0400400
401cc_library(
402 name = 'transaction',
403 hdrs = [
404 'transaction.h',
405 ],
406 deps = [
Brian Silvermancb5da1f2015-12-05 22:19:58 -0500407 '//aos/common/logging:logging',
Brian Silverman3d37a5f2014-09-05 18:42:20 -0400408 '//aos/common/util:compiler_memory_barrier',
409 ],
410)
411
412cc_test(
413 name = 'transaction_test',
414 srcs = [
415 'transaction_test.cc',
416 ],
417 deps = [
418 ':transaction',
419 '//aos/testing:googletest',
420 '//aos/common/logging',
421 '//aos/common/util:death_test_log_implementation',
422 ],
423)