blob: f2c11a2787bdaf01f56a5640012648fcfd678a4c [file] [log] [blame]
William A. Kennington IIIac730af2021-06-24 03:15:38 -07001gtest = dependency('gtest', main: true, disabler: true, required: get_option('tests'))
2gmock = dependency('gmock', disabler: true, required: get_option('tests'))
3
William A. Kennington III8d3d46a2021-07-13 12:35:35 -07004tests_pre = declare_dependency(
5 dependencies: [sys_dep, gtest, gmock])
6
7tests_lib = static_library(
8 'common',
9 'common.cpp',
Willy Tuff3cd8e2021-09-14 22:49:55 -070010 'helper.cpp',
William A. Kennington III8d3d46a2021-07-13 12:35:35 -070011 implicit_include_directories: false,
12 dependencies: tests_pre)
13
14tests_dep = declare_dependency(
15 link_with: tests_lib,
16 dependencies: tests_pre)
17
William A. Kennington IIIac730af2021-06-24 03:15:38 -070018tests = [
19 'cable',
20 'cpld',
21 'entity',
22 'eth',
23 'flash',
Steve Foreman4f0d1de2021-09-20 14:06:32 -070024 'google_accel_oob',
William A. Kennington IIIac730af2021-06-24 03:15:38 -070025 'handler',
26 'machine',
27 'pcie',
28 'poweroff',
29 'psu',
Willy Tu6c71b0f2021-10-10 13:34:41 -070030 'pcie_bifurcation',
William A. Kennington IIIac730af2021-06-24 03:15:38 -070031]
32
33foreach t : tests
34 test(
35 t,
36 executable(
37 t.underscorify(),
38 t + '_unittest.cpp',
39 implicit_include_directories: false,
William A. Kennington III8d3d46a2021-07-13 12:35:35 -070040 dependencies: tests_dep))
William A. Kennington IIIac730af2021-06-24 03:15:38 -070041endforeach