gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
gmock_dep = dependency('gmock', disabler: true, required: false)
if not gtest_dep.found() or not gmock_dep.found()
    gtest_proj = import('cmake').subproject('googletest', required: true)
    gtest_dep = declare_dependency(
        dependencies: [
            dependency('threads'),
            gtest_proj.dependency('gtest'),
            gtest_proj.dependency('gtest_main'),
        ],
    )
    gmock_dep = gtest_proj.dependency('gmock')
endif

test_include_dirs = [libpldm_include_dir, include_directories('../src')]

tests = ['instance-id', 'msgbuf', 'responder', 'utils']

subdir('dsp')

# The 'test' transport APIs will never be marked stable as they are just for
# testing.
if get_option('abi').contains('testing')
    subdir('transport')
endif

if get_option('oem').contains('ibm')
    subdir('oem/ibm')
endif

if get_option('oem').contains('meta')
    subdir('oem/meta')
endif

foreach t : tests
    test(
        t,
        executable(
            t.underscorify(),
            t + '.cpp',
            implicit_include_directories: false,
            include_directories: test_include_dirs,
            dependencies: [libpldm_dep, gtest_dep, gmock_dep],
        ),
        workdir: meson.current_source_dir(),
    )
endforeach

test(
    'msgbuf_generic',
    executable(
        'msgbuf_generic',
        'msgbuf_generic.c',
        implicit_include_directories: false,
        include_directories: test_include_dirs,
    ),
)
