blob: 0dc6f2df0e87f9e9f30f26d928b7dcc2ce059dda [file] [edit]
gtest = dependency(
'gtest',
main: true,
disabler: true,
required: get_option('tests'),
)
gmock = dependency('gmock', disabler: true, required: get_option('tests'))
if not gtest.found() or not gmock.found()
gtest_proj = subproject('gtest')
gtest = declare_dependency(
dependencies: [
gtest_proj.get_variable('gtest_dep'),
gtest_proj.get_variable('gtest_main_dep'),
],
)
gmock = gtest_proj.get_variable('gmock_dep')
endif
test_dep = declare_dependency(
include_directories: include_directories('include'),
dependencies: [libbej, gtest, gmock]
)
gtests = [
'bej_decoder',
'bej_common',
'bej_dictionary',
'bej_tree',
'bej_encoder',
]
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
libbej_test_incs = include_directories('include')
foreach t : gtests
test(
t,
executable(
t.underscorify(),
t + '_test.cpp',
build_by_default: false,
implicit_include_directories: false,
include_directories: libbej_test_incs,
dependencies: [libbej, gtest, gmock, nlohmann_json_dep],
),
)
endforeach