blob: 3582c07ab34891d82e1d7d4a8f9d10bfa6594da5 [file] [log] [blame]
Andrew Jeffery2f20c5a2021-05-27 14:52:49 +09301gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
2gmock_dep = dependency('gmock', disabler: true, required: false)
3if not gtest_dep.found() or not gmock_dep.found()
4 gtest_proj = import('cmake').subproject('googletest', required: false)
5 if gtest_proj.found()
6 gtest_dep = declare_dependency(
7 dependencies: [
8 dependency('threads'),
9 gtest_proj.dependency('gtest'),
10 gtest_proj.dependency('gtest_main'),
11 ]
12 )
13 gmock_dep = gtest_proj.dependency('gmock')
14 else
15 assert(
Patrick Williams5bc307f2023-11-29 06:44:23 -060016 not get_option('tests').allowed(),
Andrew Jeffery2f20c5a2021-05-27 14:52:49 +093017 'Googletest is required if tests are enabled'
18 )
19 endif
20endif
Brad Bishopfeb19ef2019-11-07 18:02:16 -050021
Ed Tanous16966b52021-09-15 15:06:59 -070022ut_deps_list = [
23 gtest_dep,
24]
25
26ut_deps_list += default_deps
27
Lei YUd3204142021-11-16 14:57:27 +080028test(
29 'test_utils',
30 executable(
31 'test_utils',
32 'test_Utils.cpp',
33 '../src/Utils.cpp',
Ed Tanous16966b52021-09-15 15:06:59 -070034 dependencies: ut_deps_list,
Lei YUd3204142021-11-16 14:57:27 +080035 implicit_include_directories: false,
Andrew Jefferye73bd0a2023-01-25 10:39:57 +103036 include_directories: '../src',
Lei YUd3204142021-11-16 14:57:27 +080037 )
38)