blob: 6528b929b5c4b4960384e3ec1951f256ee3584e5 [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',
kasunathbac958d2022-06-07 18:15:24 -070030 'rde_handler',
Brandon Kim55dcada2022-03-09 02:18:01 -080031]
32foreach t : gtests
33 test(t, executable(t.underscorify(), t + '_test.cpp',
34 build_by_default: false,
35 implicit_include_directories: false,
Brandon Kimfcbc3db2022-06-06 21:26:18 -070036 dependencies: test_dep))
Brandon Kim55dcada2022-03-09 02:18:01 -080037endforeach