1test_boost_args = boost_args + ['-DBOOST_ASIO_DISABLE_THREADS'] + [ 2 '-DENABLE_FRU_UPDATE_PROPERTY=1', 3] 4gtest = dependency('gtest', main: true, disabler: true, required: false) 5gmock = dependency('gmock', disabler: true, required: false) 6 7if 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 15endif 16 17test_include_dir = include_directories('../src') 18 19subdir('entity_manager') 20 21test( 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 34test( 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 46test( 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) 57