blob: 1972b021861c2a0d9a1d3fcb6d5403a728735e70 [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)
Pavithra Barithaya51efaf82020-04-02 02:42:27 -050017pldmd = declare_dependency(
18 sources: [
Deepak Kodihalli1521f6d2020-06-16 08:51:02 -050019 '../pldmd/instance_id.cpp',
20 '../pldmd/dbus_impl_requester.cpp',
Deepak Kodihalliac19bd62020-06-16 08:25:23 -050021 '../host-bmc/host_pdr_handler.cpp',
22 '../host-bmc/dbus_to_host_effecters.cpp'])
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050023
24tests = [
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050025 'libpldmresponder_base_test',
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050026 'libpldmresponder_bios_test',
John Wange2efdcc2020-02-12 17:02:06 +080027 'libpldmresponder_bios_attribute_test',
John Wang29683b52020-02-27 16:41:44 +080028 'libpldmresponder_bios_string_attribute_test',
John Wangd9659342020-02-27 16:46:05 +080029 'libpldmresponder_bios_config_test',
John Wang95e6b3c2020-02-13 09:43:24 +080030 'libpldmresponder_bios_integer_attribute_test',
John Wang3be70852020-02-13 15:59:04 +080031 'libpldmresponder_bios_enum_attribute_test',
George Liu456c9a22020-01-13 11:36:22 +080032 'libpldmresponder_pdr_effecter_test',
George Liu4371f2b2020-05-09 19:55:18 +080033 'libpldmresponder_pdr_sensor_test',
Deepak Kodihalli557dfb02019-05-12 13:11:17 +053034 'libpldmresponder_bios_table_test',
Jinu Joy Thomas8e92c6c2019-08-06 12:22:34 +053035 'libpldmresponder_platform_test',
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060036 'pldmd_instanceid_test',
Deepak Kodihallibc669f12019-11-28 08:52:07 -060037 'pldmd_registration_test',
George Liu83409572019-12-24 18:42:54 +080038 'pldm_utils_test',
Deepak Kodihalli3b02ed82020-02-06 01:18:25 -060039 'libpldmresponder_fru_test',
Tom Joseph250c4752020-04-15 10:32:45 +053040 'libpldmresponder_dbus_to_host_effecter_test',
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050041]
42
43if get_option('oem-ibm').enabled()
44 tests += [
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050045 '../oem/ibm/test/libpldmresponder_fileio_test'
46 ]
47endif
48
49foreach t : tests
50 test(t, executable(t.underscorify(), t + '.cpp',
51 implicit_include_directories: false,
52 link_args: dynamic_linker,
53 build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060054 dependencies: [
55 libpldm,
56 libpldmresponder,
George Liuab437e52020-01-19 17:12:19 +080057 libpldmutils,
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060058 gtest,
59 gmock,
60 pldmd,
61 dependency('phosphor-dbus-interfaces'),
Deepak Kodihalli8cb6f662020-04-10 02:55:43 -050062 dependency('sdeventplus'),
Deepak Kodihalli4de4d002019-11-11 02:41:43 -060063 dependency('sdbusplus')]),
Deepak Kodihalli3c275e12019-09-21 06:39:39 -050064 workdir: meson.current_source_dir())
65endforeach