blob: 0a2e81152719e2c6ad95df37b3f3a7ceedb837b6 [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
Andrew Jeffery48761c62024-06-03 15:48:26 +093015test_include_dirs = [ libpldm_include_dir, include_directories('../src') ]
Andrew Jeffery9c766792022-08-10 23:12:49 +093016
17tests = [
Andrew Jefferyb27cebf2023-04-24 11:17:05 +093018 'instance-id',
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103019 'msgbuf',
Andrew Jefferycc45aed2023-09-10 23:03:29 +093020 'responder',
Andrew Jeffery48761c62024-06-03 15:48:26 +093021 'utils',
Andrew Jeffery9c766792022-08-10 23:12:49 +093022]
23
Andrew Jeffery48761c62024-06-03 15:48:26 +093024subdir('dsp')
25
Andrew Jeffery9ca76702024-06-03 13:32:41 +093026# The 'test' transport APIs will never be marked stable as they are just for
27# testing.
Andrew Jefferyba05dba2023-08-29 14:43:04 +093028if get_option('abi').contains('testing')
Andrew Jefferyd480b702024-06-03 14:55:32 +093029 subdir('transport')
Andrew Jefferyba05dba2023-08-29 14:43:04 +093030endif
31
Andrew Jeffery8de8e1e2023-06-09 14:37:18 +093032if get_option('oem-ibm').allowed()
Andrew Jefferyd480b702024-06-03 14:55:32 +093033 subdir('oem/ibm')
Andrew Jeffery9c766792022-08-10 23:12:49 +093034endif
35
Delphine CC Chiu22fad392023-10-27 11:05:01 +080036if get_option('oem-meta').allowed()
Andrew Jefferyd480b702024-06-03 14:55:32 +093037 subdir('oem/meta')
Delphine CC Chiu22fad392023-10-27 11:05:01 +080038endif
39
Andrew Jeffery9c766792022-08-10 23:12:49 +093040foreach t : tests
41 test(t, executable(t.underscorify(), t + '.cpp',
42 implicit_include_directories: false,
Andrew Jefferyb0c1d202023-11-07 22:08:44 +103043 include_directories: test_include_dirs,
Andrew Jeffery9c766792022-08-10 23:12:49 +093044 dependencies: [
45 libpldm_dep,
46 gtest_dep,
47 gmock_dep]),
48 workdir: meson.current_source_dir())
49endforeach
50
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103051test('msgbuf_generic', executable('msgbuf_generic',
52 'msgbuf_generic.c',
53 implicit_include_directories: false,
Andrew Jefferyb0c1d202023-11-07 22:08:44 +103054 include_directories: test_include_dirs))