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( |
Brandon Kim | 93a4c0a | 2024-08-17 00:36:55 +0000 | [diff] [blame] | 5 | dependencies: [sys_dep, gtest, gmock, dependency('stdplus-gtest')]) |
William A. Kennington III | 8d3d46a | 2021-07-13 12:35:35 -0700 | [diff] [blame] | 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', |
Nikhil Namjoshi | 5e70dc8 | 2022-09-16 00:36:07 +0000 | [diff] [blame] | 31 | 'bmc_mode', |
John Wedig | a92d0e6 | 2023-06-29 10:43:47 -0700 | [diff] [blame] | 32 | 'linux_boot_done', |
Hao Zhou | 15d4d21 | 2023-07-11 20:18:04 +0000 | [diff] [blame] | 33 | 'bm_mode_transition', |
Brandon Kim | 559cb01 | 2024-05-03 09:12:07 +0000 | [diff] [blame] | 34 | 'bm_instance', |
Brandon Kim | 93a4c0a | 2024-08-17 00:36:55 +0000 | [diff] [blame] | 35 | 'bios_setting', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 36 | ] |
| 37 | |
| 38 | foreach t : tests |
| 39 | test( |
| 40 | t, |
| 41 | executable( |
| 42 | t.underscorify(), |
| 43 | t + '_unittest.cpp', |
| 44 | implicit_include_directories: false, |
William A. Kennington III | 8d3d46a | 2021-07-13 12:35:35 -0700 | [diff] [blame] | 45 | dependencies: tests_dep)) |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 46 | endforeach |