-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathmeson.build
103 lines (98 loc) · 2.73 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
gtest = dependency('gtest', main: true, disabler: true, required: false)
gmock = dependency('gmock', disabler: true, required: false)
if not gtest.found() or not gmock.found()
gtest_opts = import('cmake').subproject_options()
gtest_opts.add_cmake_defines({'CMAKE_CXX_FLAGS': '-Wno-pedantic'})
gtest_proj = import('cmake').subproject(
'googletest',
options: gtest_opts,
required: false,
)
if gtest_proj.found()
gtest = declare_dependency(
dependencies: [
dependency('threads'),
gtest_proj.dependency('gtest'),
gtest_proj.dependency('gtest_main'),
],
)
gmock = gtest_proj.dependency('gmock')
else
assert(not get_option('tests').enabled(), 'Googletest is required')
endif
endif
test(
'entitymap_json',
executable(
'entitymap_json',
'entitymap_json_unittest.cpp',
include_directories: root_inc,
build_by_default: false,
implicit_include_directories: false,
dependencies: [
entity_map_json_dep,
gmock,
gtest,
nlohmann_json_dep,
sdbusplus_dep,
],
),
)
# Build/add oemrouter_unittest to test suite
# Issue #3325
# test('oemrouter',
# executable(
# 'oemrouter',
# 'oemrouter_unittest.cpp',
# include_directories: root_inc,
# build_by_default: false,
# implicit_include_directories: false,
# dependencies: [gtest, gmock]
# ))
# Build/add message packing/unpacking unit tests
test(
'message',
executable(
'message',
'message/pack.cpp',
'message/payload.cpp',
'message/unpack.cpp',
include_directories: root_inc,
build_by_default: false,
override_options: ['b_lundef=true'],
implicit_include_directories: false,
dependencies: [
boost,
crypto,
gmock,
gtest,
libsystemd_dep,
phosphor_logging_dep,
sdbusplus_dep,
],
),
)
# Build/add closesession_unittest to test suite
test(
'session/closesession',
executable(
'session_closesession',
'session/closesession_unittest.cpp',
include_directories: root_inc,
build_by_default: false,
implicit_include_directories: false,
dependencies: [gtest, gmock],
),
)
# Build/add sensorcommands_unittest to test suite
test(
'dbus-sdr/sensorcommands',
executable(
'dbus-sdr_sensorcommands',
'dbus-sdr/sensorcommands_unittest.cpp',
include_directories: root_inc,
build_by_default: false,
implicit_include_directories: false,
dependencies: [sensorutils_dep, gtest, gmock],
),
)