1bbd1b56aSWilliam A. Kennington IIIgtest = dependency('gtest', main: true, disabler: true, required: false) 2bbd1b56aSWilliam A. Kennington IIIgmock = dependency('gmock', disabler: true, required: false) 3bbd1b56aSWilliam A. Kennington IIIif not gtest.found() or not gmock.found() 461869e0dSWilliam A. Kennington III gtest_opts = import('cmake').subproject_options() 561869e0dSWilliam A. Kennington III gtest_opts.add_cmake_defines({'CMAKE_CXX_FLAGS': '-Wno-pedantic'}) 6159a3560SWilliam A. Kennington III gtest_proj = import('cmake').subproject( 7159a3560SWilliam A. Kennington III 'googletest', 861869e0dSWilliam A. Kennington III options: gtest_opts, 9159a3560SWilliam A. Kennington III required: false) 10bbd1b56aSWilliam A. Kennington III if gtest_proj.found() 11bbd1b56aSWilliam A. Kennington III gtest = declare_dependency( 12bbd1b56aSWilliam A. Kennington III dependencies: [ 13bbd1b56aSWilliam A. Kennington III dependency('threads'), 14bbd1b56aSWilliam A. Kennington III gtest_proj.dependency('gtest'), 15bbd1b56aSWilliam A. Kennington III gtest_proj.dependency('gtest_main'), 16bbd1b56aSWilliam A. Kennington III ]) 17bbd1b56aSWilliam A. Kennington III gmock = gtest_proj.dependency('gmock') 18bbd1b56aSWilliam A. Kennington III else 19bbd1b56aSWilliam A. Kennington III assert(not build_tests.enabled(), 'Googletest is required') 20bbd1b56aSWilliam A. Kennington III endif 21bbd1b56aSWilliam A. Kennington IIIendif 22d4b33e95SWilliam A. Kennington III 23159a3560SWilliam A. Kennington III 24d4b33e95SWilliam A. Kennington IIItests = [ 25d4b33e95SWilliam A. Kennington III 'clock', 26d4b33e95SWilliam A. Kennington III 'event', 27d4b33e95SWilliam A. Kennington III 'exception', 28d4b33e95SWilliam A. Kennington III 'source/base', 29d4b33e95SWilliam A. Kennington III 'source/child', 30d4b33e95SWilliam A. Kennington III 'source/event', 31d4b33e95SWilliam A. Kennington III 'source/io', 32d4b33e95SWilliam A. Kennington III 'source/signal', 33d4b33e95SWilliam A. Kennington III 'source/time', 34*a4c76ea9SWilliam A. Kennington III 'utility/sdbus', 35d4b33e95SWilliam A. Kennington III 'utility/timer', 36d4b33e95SWilliam A. Kennington III] 37d4b33e95SWilliam A. Kennington III 38d4b33e95SWilliam A. Kennington IIIforeach t : tests 39*a4c76ea9SWilliam A. Kennington III test(t, 40*a4c76ea9SWilliam A. Kennington III executable( 41*a4c76ea9SWilliam A. Kennington III t.underscorify(), 42*a4c76ea9SWilliam A. Kennington III t + '.cpp', 43d4b33e95SWilliam A. Kennington III implicit_include_directories: false, 44*a4c76ea9SWilliam A. Kennington III dependencies: [ 45*a4c76ea9SWilliam A. Kennington III dependency('sdbusplus'), 46*a4c76ea9SWilliam A. Kennington III sdeventplus_dep, 47*a4c76ea9SWilliam A. Kennington III gtest, 48*a4c76ea9SWilliam A. Kennington III gmock, 49*a4c76ea9SWilliam A. Kennington III ])) 50d4b33e95SWilliam A. Kennington IIIendforeach 51