| Naresh Solanki | 89092a9 | 2025-06-02 15:48:04 +0530 | [diff] [blame] | 1 | test_boost_args = boost_args + ['-DBOOST_ASIO_DISABLE_THREADS'] + [ | 
|  | 2 | '-DENABLE_FRU_UPDATE_PROPERTY=1', | 
|  | 3 | ] | 
| Alexander Hansen | f440def | 2025-06-17 16:29:59 +0200 | [diff] [blame] | 4 | gtest = dependency('gtest', main: true, disabler: true, required: false) | 
|  | 5 | gmock = dependency('gmock', disabler: true, required: false) | 
|  | 6 |  | 
|  | 7 | if not (gtest.found() and gmock.found()) | 
|  | 8 | cmake = import('cmake') | 
|  | 9 | gtest_subproject = cmake.subproject('gtest') | 
|  | 10 | cm_gtest = gtest_subproject.dependency('gtest') | 
|  | 11 | cm_gtest_main = gtest_subproject.dependency('gtest_main') | 
|  | 12 | gtest = declare_dependency(dependencies: [cm_gtest, cm_gtest_main, threads]) | 
|  | 13 | gmock = gtest_subproject.dependency('gmock') | 
|  | 14 |  | 
|  | 15 | endif | 
|  | 16 |  | 
| Alexander Hansen | 6f4c6b4 | 2025-06-27 16:42:35 +0200 | [diff] [blame] | 17 | test_include_dir = include_directories('../src') | 
| Alexander Hansen | f440def | 2025-06-17 16:29:59 +0200 | [diff] [blame] | 18 |  | 
| Alexander Hansen | 6f4c6b4 | 2025-06-27 16:42:35 +0200 | [diff] [blame] | 19 | subdir('entity_manager') | 
| Alexander Hansen | f440def | 2025-06-17 16:29:59 +0200 | [diff] [blame] | 20 |  | 
|  | 21 | test( | 
|  | 22 | 'test_fru_utils', | 
|  | 23 | executable( | 
|  | 24 | 'test_fru_utils', | 
|  | 25 | 'test_fru-utils.cpp', | 
|  | 26 | '../src/fru_device/fru_utils.cpp', | 
|  | 27 | '../src/fru_device/fru_reader.cpp', | 
|  | 28 | cpp_args: test_boost_args, | 
|  | 29 | dependencies: [boost, gtest, gmock, phosphor_logging_dep, sdbusplus], | 
|  | 30 | include_directories: test_include_dir, | 
|  | 31 | ), | 
|  | 32 | ) | 
|  | 33 |  | 
|  | 34 | test( | 
|  | 35 | 'test_topology', | 
|  | 36 | executable( | 
|  | 37 | 'test_topology', | 
|  | 38 | 'test_topology.cpp', | 
|  | 39 | '../src/entity_manager/topology.cpp', | 
|  | 40 | cpp_args: test_boost_args, | 
|  | 41 | dependencies: [gtest, gmock, nlohmann_json_dep, phosphor_logging_dep], | 
|  | 42 | include_directories: test_include_dir, | 
|  | 43 | ), | 
|  | 44 | ) | 
|  | 45 |  | 
|  | 46 | test( | 
|  | 47 | 'test_gpio_presence', | 
|  | 48 | executable( | 
|  | 49 | 'test_gpio_presence', | 
|  | 50 | 'test_gpio_presence.cpp', | 
|  | 51 | cpp_args: test_boost_args, | 
|  | 52 | include_directories: test_include_dir, | 
|  | 53 | dependencies: [boost, gtest, gmock, phosphor_logging_dep, libgpio_dep], | 
|  | 54 | link_with: gpio_presence_lib, | 
|  | 55 | ), | 
|  | 56 | ) |