blob: aba89bc0fdbf224c8027eff376d1b0ea287d2785 [file] [log] [blame]
Andrew Jeffery9c766792022-08-10 23:12:49 +09301gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
2gmock_dep = dependency('gmock', disabler: true, required: false)
3if not gtest_dep.found() or not gmock_dep.found()
4 gtest_proj = import('cmake').subproject('googletest', required: true)
5 gtest_dep = declare_dependency(
6 dependencies: [
7 dependency('threads'),
8 gtest_proj.dependency('gtest'),
9 gtest_proj.dependency('gtest_main'),
10 ]
11 )
12 gmock_dep = gtest_proj.dependency('gmock')
13endif
14
15
16tests = [
17 'libpldm_base_test',
18 'libpldm_platform_test',
19 'libpldm_bios_test',
20 'libpldm_bios_table_test',
21 'libpldm_fru_test',
22 'libpldm_utils_test',
23 'libpldm_pdr_test',
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103024 'libpldm_firmware_update_test',
25 'msgbuf',
Andrew Jeffery9c766792022-08-10 23:12:49 +093026]
27
28if get_option('oem-ibm').enabled()
29 tests += [
30 'oem/ibm/libpldm_fileio_test',
31 'oem/ibm/libpldm_host_test',
32 ]
33endif
34
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103035src_includes = include_directories('..' / 'src', '..' / 'include' / 'libpldm')
36
Andrew Jeffery9c766792022-08-10 23:12:49 +093037foreach t : tests
38 test(t, executable(t.underscorify(), t + '.cpp',
39 implicit_include_directories: false,
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103040 include_directories: src_includes,
Andrew Jeffery9c766792022-08-10 23:12:49 +093041 dependencies: [
42 libpldm_dep,
43 gtest_dep,
44 gmock_dep]),
45 workdir: meson.current_source_dir())
46endforeach
47
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103048test('msgbuf_generic', executable('msgbuf_generic',
49 'msgbuf_generic.c',
50 implicit_include_directories: false,
51 include_directories: src_includes))