William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 1 | gtest = dependency('gtest', main: true, disabler: true, required: get_option('tests')) |
| 2 | gmock = dependency('gmock', disabler: true, required: get_option('tests')) |
| 3 | |
William A. Kennington III | 8d3d46a | 2021-07-13 12:35:35 -0700 | [diff] [blame] | 4 | tests_pre = declare_dependency( |
| 5 | dependencies: [sys_dep, gtest, gmock]) |
| 6 | |
| 7 | tests_lib = static_library( |
| 8 | 'common', |
| 9 | 'common.cpp', |
| 10 | implicit_include_directories: false, |
| 11 | dependencies: tests_pre) |
| 12 | |
| 13 | tests_dep = declare_dependency( |
| 14 | link_with: tests_lib, |
| 15 | dependencies: tests_pre) |
| 16 | |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 17 | tests = [ |
| 18 | 'cable', |
| 19 | 'cpld', |
| 20 | 'entity', |
| 21 | 'eth', |
| 22 | 'flash', |
| 23 | 'handler', |
| 24 | 'machine', |
| 25 | 'pcie', |
| 26 | 'poweroff', |
| 27 | 'psu', |
| 28 | ] |
| 29 | |
| 30 | foreach t : tests |
| 31 | test( |
| 32 | t, |
| 33 | executable( |
| 34 | t.underscorify(), |
| 35 | t + '_unittest.cpp', |
| 36 | implicit_include_directories: false, |
William A. Kennington III | 8d3d46a | 2021-07-13 12:35:35 -0700 | [diff] [blame] | 37 | dependencies: tests_dep)) |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 38 | endforeach |