xref: /openbmc/sdeventplus/test/meson.build (revision bbd1b56a)
1gtest = 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
17
18tests = [
19  'clock',
20  'event',
21  'exception',
22  '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',
34                     implicit_include_directories: false,
35                     dependencies: [sdeventplus, gtest, gmock]))
36endforeach
37