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', |
Willy Tu | ff3cd8e | 2021-09-14 22:49:55 -0700 | [diff] [blame] | 10 | 'helper.cpp', |
William A. Kennington III | 8d3d46a | 2021-07-13 12:35:35 -0700 | [diff] [blame] | 11 | implicit_include_directories: false, |
| 12 | dependencies: tests_pre) |
| 13 | |
| 14 | tests_dep = declare_dependency( |
| 15 | link_with: tests_lib, |
| 16 | dependencies: tests_pre) |
| 17 | |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 18 | tests = [ |
| 19 | 'cable', |
| 20 | 'cpld', |
| 21 | 'entity', |
| 22 | 'eth', |
| 23 | 'flash', |
Steve Foreman | 4f0d1de | 2021-09-20 14:06:32 -0700 | [diff] [blame] | 24 | 'google_accel_oob', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 25 | 'handler', |
| 26 | 'machine', |
| 27 | 'pcie', |
| 28 | 'poweroff', |
| 29 | 'psu', |
Willy Tu | 6c71b0f | 2021-10-10 13:34:41 -0700 | [diff] [blame^] | 30 | 'pcie_bifurcation', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 31 | ] |
| 32 | |
| 33 | foreach t : tests |
| 34 | test( |
| 35 | t, |
| 36 | executable( |
| 37 | t.underscorify(), |
| 38 | t + '_unittest.cpp', |
| 39 | implicit_include_directories: false, |
William A. Kennington III | 8d3d46a | 2021-07-13 12:35:35 -0700 | [diff] [blame] | 40 | dependencies: tests_dep)) |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 41 | endforeach |