1phosphor_regulators_tests_include_directories = include_directories(
2    '.',
3    'actions'
4)
5
6phosphor_regulators_tests_source_files = [
7    'chassis_tests.cpp',
8    'config_file_parser_error_tests.cpp',
9    'config_file_parser_tests.cpp',
10    'configuration_tests.cpp',
11    'device_tests.cpp',
12    'error_history_tests.cpp',
13    'error_logging_utils_tests.cpp',
14    'exception_utils_tests.cpp',
15    'ffdc_file_tests.cpp',
16    'id_map_tests.cpp',
17    'phase_fault_detection_tests.cpp',
18    'phase_fault_tests.cpp',
19    'pmbus_error_tests.cpp',
20    'pmbus_utils_tests.cpp',
21    'presence_detection_tests.cpp',
22    'rail_tests.cpp',
23    'rule_tests.cpp',
24    'sensor_monitoring_tests.cpp',
25    'sensors_tests.cpp',
26    'system_tests.cpp',
27    'write_verification_error_tests.cpp',
28
29    'actions/action_environment_tests.cpp',
30    'actions/action_error_tests.cpp',
31    'actions/action_utils_tests.cpp',
32    'actions/and_action_tests.cpp',
33    'actions/compare_presence_action_tests.cpp',
34    'actions/compare_vpd_action_tests.cpp',
35    'actions/i2c_action_tests.cpp',
36    'actions/i2c_capture_bytes_action_tests.cpp',
37    'actions/i2c_compare_bit_action_tests.cpp',
38    'actions/i2c_compare_byte_action_tests.cpp',
39    'actions/i2c_compare_bytes_action_tests.cpp',
40    'actions/i2c_write_bit_action_tests.cpp',
41    'actions/i2c_write_byte_action_tests.cpp',
42    'actions/i2c_write_bytes_action_tests.cpp',
43    'actions/if_action_tests.cpp',
44    'actions/log_phase_fault_action_tests.cpp',
45    'actions/not_action_tests.cpp',
46    'actions/or_action_tests.cpp',
47    'actions/pmbus_read_sensor_action_tests.cpp',
48    'actions/pmbus_write_vout_command_action_tests.cpp',
49    'actions/run_rule_action_tests.cpp',
50    'actions/set_device_action_tests.cpp'
51]
52
53# Long-running tests that are excluded from CI
54if get_option('long-tests').allowed()
55    # This test requires the Python module 'jsonschema'
56    phosphor_regulators_tests_source_files += 'validate-regulators-config_tests.cpp'
57endif
58
59test('phosphor-regulators-tests',
60     executable('phosphor-regulators-tests',
61                phosphor_regulators_tests_source_files,
62                dependencies: [
63                    gmock,
64                    gtest,
65                    nlohmann_json_dep,
66                    phosphor_dbus_interfaces,
67                    phosphor_logging,
68                    sdbusplus,
69                ],
70                link_args: dynamic_linker,
71                build_rpath: get_option('oe-sdk').allowed() ? rpath : '',
72                link_with: [
73                    phosphor_regulators_library,
74                    libi2c_dev_mock,
75                    libpower
76                ],
77                implicit_include_directories: false,
78                include_directories: [
79                    phosphor_regulators_include_directories,
80                    phosphor_regulators_tests_include_directories,
81                    libi2c_inc,
82                    libi2c_dev_mock_inc
83                ]
84     ),
85     timeout : 180
86)
87