1gtest = 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 20test_dep = declare_dependency( 21 include_directories: include_directories('include'), 22 dependencies: [bios_bmc_smm_error_logger_dep, gtest, gmock, rde_dep] 23) 24 25gtests = [ 26 'pci_handler', 27 'rde_dictionary_manager', 28 'buffer', 29 'external_storer_file', 30 'rde_handler', 31] 32foreach t : gtests 33 test(t, executable(t.underscorify(), t + '_test.cpp', 34 build_by_default: false, 35 implicit_include_directories: false, 36 dependencies: test_dep)) 37endforeach 38