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