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]) 6 7tests_lib = static_library( 8 'common', 9 'common.cpp', 10 implicit_include_directories: false, 11 dependencies: tests_pre) 12 13tests_dep = declare_dependency( 14 link_with: tests_lib, 15 dependencies: tests_pre) 16 17tests = [ 18 'cable', 19 'cpld', 20 'entity', 21 'eth', 22 'flash', 23 'handler', 24 'machine', 25 'pcie', 26 'poweroff', 27 'psu', 28] 29 30foreach t : tests 31 test( 32 t, 33 executable( 34 t.underscorify(), 35 t + '_unittest.cpp', 36 implicit_include_directories: false, 37 dependencies: tests_dep)) 38endforeach 39