blob: e520f8b65bb1729efacdbf3539f9539271a3c4ea [file] [log] [blame]
William A. Kennington IIIbbd1b562020-02-20 15:15:19 -08001gtest = dependency('gtest', main: true, disabler: true, required: false)
2gmock = dependency('gmock', disabler: true, required: false)
3if not gtest.found() or not gmock.found()
4 gtest_proj = import('cmake').subproject('googletest', required: false)
5 if gtest_proj.found()
6 gtest = declare_dependency(
7 dependencies: [
8 dependency('threads'),
9 gtest_proj.dependency('gtest'),
10 gtest_proj.dependency('gtest_main'),
11 ])
12 gmock = gtest_proj.dependency('gmock')
13 else
14 assert(not build_tests.enabled(), 'Googletest is required')
15 endif
16endif
William A. Kennington IIId4b33e92018-12-04 17:22:05 -080017
18tests = [
19 'clock',
20 'event',
21 'exception',
William A. Kennington IIId4b33e92018-12-04 17:22:05 -080022 'internal/utils',
23 'source/base',
24 'source/child',
25 'source/event',
26 'source/io',
27 'source/signal',
28 'source/time',
29 'utility/timer',
30]
31
32foreach t : tests
33 test(t, executable(t.underscorify(), t + '.cpp',
William A. Kennington IIId4b33e92018-12-04 17:22:05 -080034 implicit_include_directories: false,
William A. Kennington III8ec59e62019-04-03 13:38:17 -070035 dependencies: [sdeventplus, gtest, gmock]))
William A. Kennington IIId4b33e92018-12-04 17:22:05 -080036endforeach