| 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', | 
| Ed Tanous | 10c5765 | 2025-09-30 10:24:57 -0700 | [diff] [blame] | 26 | 'test_gzip-utils.cpp', | 
| Alexander Hansen | f440def | 2025-06-17 16:29:59 +0200 | [diff] [blame] | 27 | '../src/fru_device/fru_utils.cpp', | 
|  | 28 | '../src/fru_device/fru_reader.cpp', | 
| Ed Tanous | 10c5765 | 2025-09-30 10:24:57 -0700 | [diff] [blame] | 29 | '../src/fru_device/gzip_utils.cpp', | 
| Alexander Hansen | f440def | 2025-06-17 16:29:59 +0200 | [diff] [blame] | 30 | cpp_args: test_boost_args, | 
| Ed Tanous | 10c5765 | 2025-09-30 10:24:57 -0700 | [diff] [blame] | 31 | dependencies: [ | 
|  | 32 | boost, | 
|  | 33 | gmock, | 
|  | 34 | gtest, | 
|  | 35 | libxml2_dep, | 
|  | 36 | phosphor_logging_dep, | 
|  | 37 | sdbusplus, | 
|  | 38 | zlib_dep, | 
|  | 39 | ], | 
| Alexander Hansen | f440def | 2025-06-17 16:29:59 +0200 | [diff] [blame] | 40 | include_directories: test_include_dir, | 
|  | 41 | ), | 
|  | 42 | ) | 
|  | 43 |  | 
|  | 44 | test( | 
|  | 45 | 'test_topology', | 
|  | 46 | executable( | 
|  | 47 | 'test_topology', | 
|  | 48 | 'test_topology.cpp', | 
|  | 49 | '../src/entity_manager/topology.cpp', | 
|  | 50 | cpp_args: test_boost_args, | 
|  | 51 | dependencies: [gtest, gmock, nlohmann_json_dep, phosphor_logging_dep], | 
|  | 52 | include_directories: test_include_dir, | 
|  | 53 | ), | 
|  | 54 | ) | 
|  | 55 |  | 
|  | 56 | test( | 
|  | 57 | 'test_gpio_presence', | 
|  | 58 | executable( | 
|  | 59 | 'test_gpio_presence', | 
|  | 60 | 'test_gpio_presence.cpp', | 
|  | 61 | cpp_args: test_boost_args, | 
|  | 62 | include_directories: test_include_dir, | 
|  | 63 | dependencies: [boost, gtest, gmock, phosphor_logging_dep, libgpio_dep], | 
|  | 64 | link_with: gpio_presence_lib, | 
|  | 65 | ), | 
|  | 66 | ) | 
| George Liu | ce8d1d0 | 2025-08-25 08:58:25 +0800 | [diff] [blame] | 67 |  | 
|  | 68 | test( | 
|  | 69 | 'test_utils', | 
|  | 70 | executable( | 
|  | 71 | 'test_utils', | 
|  | 72 | 'test_utils.cpp', | 
|  | 73 | '../src/utils.cpp', | 
|  | 74 | include_directories: test_include_dir, | 
| Ed Tanous | c5a2af9 | 2025-08-25 08:58:25 +0800 | [diff] [blame] | 75 | dependencies: [gtest, phosphor_logging_dep, sdbusplus], | 
| George Liu | ce8d1d0 | 2025-08-25 08:58:25 +0800 | [diff] [blame] | 76 | ), | 
|  | 77 | ) | 
| Patrick Williams | a005e3e | 2025-10-10 19:36:12 -0400 | [diff] [blame] | 78 |  | 
|  | 79 | test( | 
|  | 80 | 'test_gpio_presence_state', | 
|  | 81 | executable( | 
|  | 82 | 'test_gpio_presence_state', | 
|  | 83 | 'test_gpio_presence_state.cpp', | 
|  | 84 | cpp_args: test_boost_args, | 
|  | 85 | include_directories: test_include_dir, | 
|  | 86 | dependencies: [boost, gtest, gmock, phosphor_logging_dep, libgpio_dep], | 
|  | 87 | link_with: gpio_presence_lib, | 
|  | 88 | ), | 
|  | 89 | ) |