blob: 644b7fd3078e2b45ab1c8e62d0c9008567d78257 [file] [log] [blame]
Deepak Kodihalli3c275e12019-09-21 06:39:39 -05001if get_option('oe-sdk').enabled()
2 # Setup OE SYSROOT
3 OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip()
4 if OECORE_TARGET_SYSROOT == ''
5 error('Unable to get $OECORE_TARGET_SYSROOT, check your environment.')
6 endif
7 message('OE_SYSROOT: ' + OECORE_TARGET_SYSROOT)
8 rpath = ':'.join([OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib'])
9 ld_so = run_command('sh', '-c', 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1').stdout().strip()
10 dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so]
11else
12 dynamic_linker = []
13endif
14
15gtest = dependency('gtest', main: true, disabler: true, required: true)
16gmock = dependency('gmock', disabler: true, required: true)
George Liuab437e52020-01-19 17:12:19 +080017pldmd = declare_dependency(sources: '../instance_id.cpp')
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050018
19tests = [
20 'libpldm_base_test',
21 'libpldm_platform_test',
22 'libpldmresponder_base_test',
23 'libpldm_bios_test',
John Wang02700402019-10-06 16:34:29 +080024 'libpldm_bios_table_test',
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050025 'libpldmresponder_bios_test',
26 'libpldmresponder_pdr_state_effecter_test',
Deepak Kodihalli557dfb02019-05-12 13:11:17 +053027 'libpldmresponder_bios_table_test',
Jinu Joy Thomas8e92c6c2019-08-06 12:22:34 +053028 'libpldmresponder_platform_test',
29 'libpldm_fru_test',
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060030 'libpldm_utils_test',
31 'pldmd_instanceid_test',
Deepak Kodihallibc669f12019-11-28 08:52:07 -060032 'pldmd_registration_test',
George Liu83409572019-12-24 18:42:54 +080033 'pldm_utils_test',
Deepak Kodihalli3b02ed82020-02-06 01:18:25 -060034 'libpldmresponder_fru_test',
35 'libpldm_pdr_test'
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050036]
37
38if get_option('oem-ibm').enabled()
39 tests += [
40 '../oem/ibm/test/libpldm_fileio_test',
41 '../oem/ibm/test/libpldmresponder_fileio_test'
42 ]
43endif
44
45foreach t : tests
46 test(t, executable(t.underscorify(), t + '.cpp',
47 implicit_include_directories: false,
48 link_args: dynamic_linker,
49 build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060050 dependencies: [
51 libpldm,
52 libpldmresponder,
George Liuab437e52020-01-19 17:12:19 +080053 libpldmutils,
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060054 gtest,
55 gmock,
56 pldmd,
57 dependency('phosphor-dbus-interfaces'),
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060058 dependency('sdbusplus')]),
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050059 workdir: meson.current_source_dir())
60endforeach