blob: 27103efae60aa01a5bba136b06dc3b2c0b80ef60 [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 = [
Andrew Jefferyb27cebf2023-04-24 11:17:05 +093017 'instance-id',
Andrew Jeffery9c766792022-08-10 23:12:49 +093018 'libpldm_base_test',
Andrew Jeffery9c766792022-08-10 23:12:49 +093019 'libpldm_bios_table_test',
Andrew Jeffery44925df2024-06-03 13:19:28 +093020 'libpldm_bios_test',
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103021 'libpldm_firmware_update_test',
Andrew Jeffery44925df2024-06-03 13:19:28 +093022 'libpldm_fru_test',
23 'libpldm_pdr_test',
24 'libpldm_platform_test',
25 'libpldm_utils_test',
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103026 'msgbuf',
Andrew Jefferycc45aed2023-09-10 23:03:29 +093027 'responder',
Andrew Jeffery9c766792022-08-10 23:12:49 +093028]
29
Andrew Jeffery9ca76702024-06-03 13:32:41 +093030# The 'test' transport APIs will never be marked stable as they are just for
31# testing.
Andrew Jefferyba05dba2023-08-29 14:43:04 +093032if get_option('abi').contains('testing')
Andrew Jefferyd480b702024-06-03 14:55:32 +093033 subdir('transport')
Andrew Jefferyba05dba2023-08-29 14:43:04 +093034endif
35
Andrew Jeffery8de8e1e2023-06-09 14:37:18 +093036if get_option('oem-ibm').allowed()
Andrew Jefferyd480b702024-06-03 14:55:32 +093037 subdir('oem/ibm')
Andrew Jeffery9c766792022-08-10 23:12:49 +093038endif
39
Delphine CC Chiu22fad392023-10-27 11:05:01 +080040if get_option('oem-meta').allowed()
Andrew Jefferyd480b702024-06-03 14:55:32 +093041 subdir('oem/meta')
Delphine CC Chiu22fad392023-10-27 11:05:01 +080042endif
43
Andrew Jefferyb0c1d202023-11-07 22:08:44 +103044test_include_dirs = [ libpldm_include_dir, include_directories('../src') ]
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103045
Andrew Jeffery9c766792022-08-10 23:12:49 +093046foreach t : tests
47 test(t, executable(t.underscorify(), t + '.cpp',
48 implicit_include_directories: false,
Andrew Jefferyb0c1d202023-11-07 22:08:44 +103049 include_directories: test_include_dirs,
Andrew Jeffery9c766792022-08-10 23:12:49 +093050 dependencies: [
51 libpldm_dep,
52 gtest_dep,
53 gmock_dep]),
54 workdir: meson.current_source_dir())
55endforeach
56
Andrew Jeffery73d91762023-06-28 12:19:19 +093057test('bios_table_iter', executable('bios_table_iter',
58 'bios_table_iter.c',
59 implicit_include_directories: false,
Andrew Jefferyb0c1d202023-11-07 22:08:44 +103060 include_directories: test_include_dirs))
Andrew Jeffery73d91762023-06-28 12:19:19 +093061
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103062test('msgbuf_generic', executable('msgbuf_generic',
63 'msgbuf_generic.c',
64 implicit_include_directories: false,
Andrew Jefferyb0c1d202023-11-07 22:08:44 +103065 include_directories: test_include_dirs))