1gtest = dependency('gtest', main: true, disabler: true, required: get_option('tests')) 2gmock = dependency('gmock', disabler: true, required: get_option('tests')) 3 4tests_pre = declare_dependency( 5 dependencies: [sys_dep, gtest, gmock, dependency('stdplus-gtest')]) 6 7tests_lib = static_library( 8 'common', 9 'common.cpp', 10 'helper.cpp', 11 implicit_include_directories: false, 12 dependencies: tests_pre) 13 14tests_dep = declare_dependency( 15 link_with: tests_lib, 16 dependencies: tests_pre) 17 18tests = [ 19 'cable', 20 'cpld', 21 'entity', 22 'eth', 23 'flash', 24 'google_accel_oob', 25 'handler', 26 'machine', 27 'pcie', 28 'poweroff', 29 'psu', 30 'pcie_bifurcation', 31 'bmc_mode', 32 'linux_boot_done', 33 'bm_mode_transition', 34 'bm_instance', 35 'bios_setting', 36] 37 38foreach t : tests 39 test( 40 t, 41 executable( 42 t.underscorify(), 43 t + '_unittest.cpp', 44 implicit_include_directories: false, 45 dependencies: tests_dep)) 46endforeach 47