blob: 6f72d9f4816cde14a7d55ba5ce2107750d2b66c2 [file] [log] [blame]
Brandon Kim55dcada2022-03-09 02:18:01 -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_opt = import('cmake').subproject_options()
5 gtest_opt.append_compile_args('c++', ['-DCMAKE_CXX_FLAGS=-Wno-pedantic'])
6 gtest_proj = cmake.subproject('googletest', options: gtest_opt, required: false)
7 fmt_depj.dependency('fmt')
8
9 if gtest_proj.found()
10 gtest = declare_dependency(
11 dependencies: [
12 dependency('threads'),
13 gtest_proj.dependency('gtest'),
14 gtest_proj.dependency('gtest_main'),
15 ])
16 gmock = gtest_proj.dependency('gmock')
17 endif
18endif
19
Brandon Kimfcbc3db2022-06-06 21:26:18 -070020test_dep = declare_dependency(
21 include_directories: include_directories('include'),
22 dependencies: [bios_bmc_smm_error_logger_dep, gtest, gmock, rde_dep]
23)
24
Brandon Kim55dcada2022-03-09 02:18:01 -080025gtests = [
26 'pci_handler',
kasunatha1a69f12022-05-27 14:31:38 -070027 'rde_dictionary_manager',
Brandon Kimfcbc3db2022-06-06 21:26:18 -070028 'buffer',
Brandon Kim55dcada2022-03-09 02:18:01 -080029]
30foreach t : gtests
31 test(t, executable(t.underscorify(), t + '_test.cpp',
32 build_by_default: false,
33 implicit_include_directories: false,
Brandon Kimfcbc3db2022-06-06 21:26:18 -070034 dependencies: test_dep))
Brandon Kim55dcada2022-03-09 02:18:01 -080035endforeach