blob: 01a92a2e2f0fbba7e90f0413e8abd0132a6f5a1d [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',
kasunath37bc0df2022-06-07 12:40:26 -070029 'external_storer_file',
Brandon Kim55dcada2022-03-09 02:18:01 -080030]
31foreach t : gtests
32 test(t, executable(t.underscorify(), t + '_test.cpp',
33 build_by_default: false,
34 implicit_include_directories: false,
Brandon Kimfcbc3db2022-06-06 21:26:18 -070035 dependencies: test_dep))
Brandon Kim55dcada2022-03-09 02:18:01 -080036endforeach