blob: a32cf8dc7e442934adce625f6e5ef459395a44c7 [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(
Andrew Jefferye984a462024-09-07 11:23:28 +02006 dependencies: [
7 dependency('threads'),
8 gtest_proj.dependency('gtest'),
9 gtest_proj.dependency('gtest_main'),
10 ],
11 )
12 gmock_dep = gtest_proj.dependency('gmock')
Andrew Jeffery9c766792022-08-10 23:12:49 +093013endif
14
Andrew Jefferye984a462024-09-07 11:23:28 +020015test_include_dirs = [libpldm_include_dir, include_directories('../src')]
Andrew Jeffery9c766792022-08-10 23:12:49 +093016
Andrew Jefferye984a462024-09-07 11:23:28 +020017tests = ['instance-id', 'msgbuf', 'responder', 'utils']
Andrew Jeffery9c766792022-08-10 23:12:49 +093018
Andrew Jeffery48761c62024-06-03 15:48:26 +093019subdir('dsp')
20
Andrew Jeffery9ca76702024-06-03 13:32:41 +093021# The 'test' transport APIs will never be marked stable as they are just for
22# testing.
Andrew Jefferyba05dba2023-08-29 14:43:04 +093023if get_option('abi').contains('testing')
Andrew Jefferye984a462024-09-07 11:23:28 +020024 subdir('transport')
Andrew Jefferyba05dba2023-08-29 14:43:04 +093025endif
26
Andrew Jeffery8de8e1e2023-06-09 14:37:18 +093027if get_option('oem-ibm').allowed()
Andrew Jefferye984a462024-09-07 11:23:28 +020028 subdir('oem/ibm')
Andrew Jeffery9c766792022-08-10 23:12:49 +093029endif
30
Delphine CC Chiu22fad392023-10-27 11:05:01 +080031if get_option('oem-meta').allowed()
Andrew Jefferye984a462024-09-07 11:23:28 +020032 subdir('oem/meta')
Delphine CC Chiu22fad392023-10-27 11:05:01 +080033endif
34
Andrew Jeffery9c766792022-08-10 23:12:49 +093035foreach t : tests
Andrew Jefferye984a462024-09-07 11:23:28 +020036 test(
37 t,
38 executable(
39 t.underscorify(),
40 t + '.cpp',
41 implicit_include_directories: false,
42 include_directories: test_include_dirs,
43 dependencies: [libpldm_dep, gtest_dep, gmock_dep],
44 ),
45 workdir: meson.current_source_dir(),
46 )
Andrew Jeffery9c766792022-08-10 23:12:49 +093047endforeach
48
Andrew Jefferye984a462024-09-07 11:23:28 +020049test(
50 'msgbuf_generic',
51 executable(
52 'msgbuf_generic',
53 'msgbuf_generic.c',
54 implicit_include_directories: false,
55 include_directories: test_include_dirs,
56 ),
57)