blob: 9a6308a036674b5f66541b27a8c383836273d12f [file] [log] [blame]
Patrick Williams4d6a7b32025-02-01 08:38:43 -05001gtest = dependency(
2 'gtest',
3 main: true,
4 disabler: true,
5 required: get_option('tests'),
6)
William A. Kennington IIIac730af2021-06-24 03:15:38 -07007gmock = dependency('gmock', disabler: true, required: get_option('tests'))
8
William A. Kennington III8d3d46a2021-07-13 12:35:35 -07009tests_pre = declare_dependency(
Patrick Williams4d6a7b32025-02-01 08:38:43 -050010 dependencies: [sys_dep, gtest, gmock, dependency('stdplus-gtest')],
11)
William A. Kennington III8d3d46a2021-07-13 12:35:35 -070012
13tests_lib = static_library(
Patrick Williams4d6a7b32025-02-01 08:38:43 -050014 'common',
15 'common.cpp',
16 'helper.cpp',
17 implicit_include_directories: false,
18 dependencies: tests_pre,
19)
William A. Kennington III8d3d46a2021-07-13 12:35:35 -070020
Patrick Williams4d6a7b32025-02-01 08:38:43 -050021tests_dep = declare_dependency(link_with: tests_lib, dependencies: tests_pre)
William A. Kennington III8d3d46a2021-07-13 12:35:35 -070022
William A. Kennington IIIac730af2021-06-24 03:15:38 -070023tests = [
Patrick Williams4d6a7b32025-02-01 08:38:43 -050024 'cable',
25 'cpld',
26 'entity',
27 'eth',
28 'flash',
29 'google_accel_oob',
30 'handler',
31 'machine',
32 'pcie',
33 'poweroff',
34 'psu',
35 'pcie_bifurcation',
36 'bmc_mode',
37 'linux_boot_done',
38 'bm_mode_transition',
39 'bm_instance',
40 'bios_setting',
William A. Kennington IIIac730af2021-06-24 03:15:38 -070041]
42
43foreach t : tests
Patrick Williams4d6a7b32025-02-01 08:38:43 -050044 test(
45 t,
46 executable(
47 t.underscorify(),
48 t + '_unittest.cpp',
49 implicit_include_directories: false,
50 dependencies: tests_dep,
51 ),
52 )
William A. Kennington IIIac730af2021-06-24 03:15:38 -070053endforeach