Deepak Kodihalli | 3c275e1 | 2019-09-21 06:39:39 -0500 | [diff] [blame] | 1 | if 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] |
| 11 | else |
| 12 | dynamic_linker = [] |
| 13 | endif |
| 14 | |
| 15 | gtest = dependency('gtest', main: true, disabler: true, required: true) |
| 16 | gmock = dependency('gmock', disabler: true, required: true) |
Deepak Kodihalli | 4de4d00 | 2019-11-11 02:41:43 -0600 | [diff] [blame] | 17 | pldmd = declare_dependency(sources: '../instance_id.cpp') |
Deepak Kodihalli | 3c275e1 | 2019-09-21 06:39:39 -0500 | [diff] [blame] | 18 | |
| 19 | tests = [ |
| 20 | 'libpldm_base_test', |
| 21 | 'libpldm_platform_test', |
| 22 | 'libpldmresponder_base_test', |
| 23 | 'libpldm_bios_test', |
John Wang | 0270040 | 2019-10-06 16:34:29 +0800 | [diff] [blame] | 24 | 'libpldm_bios_table_test', |
Deepak Kodihalli | 3c275e1 | 2019-09-21 06:39:39 -0500 | [diff] [blame] | 25 | 'libpldmresponder_bios_test', |
| 26 | 'libpldmresponder_pdr_state_effecter_test', |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 27 | 'libpldmresponder_bios_table_test', |
Jinu Joy Thomas | 8e92c6c | 2019-08-06 12:22:34 +0530 | [diff] [blame] | 28 | 'libpldmresponder_platform_test', |
| 29 | 'libpldm_fru_test', |
Deepak Kodihalli | 4de4d00 | 2019-11-11 02:41:43 -0600 | [diff] [blame] | 30 | 'libpldm_utils_test', |
| 31 | 'pldmd_instanceid_test', |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 32 | 'pldmd_registration_test', |
Deepak Kodihalli | 3c275e1 | 2019-09-21 06:39:39 -0500 | [diff] [blame] | 33 | ] |
| 34 | |
| 35 | if get_option('oem-ibm').enabled() |
| 36 | tests += [ |
| 37 | '../oem/ibm/test/libpldm_fileio_test', |
| 38 | '../oem/ibm/test/libpldmresponder_fileio_test' |
| 39 | ] |
| 40 | endif |
| 41 | |
| 42 | foreach t : tests |
| 43 | test(t, executable(t.underscorify(), t + '.cpp', |
| 44 | implicit_include_directories: false, |
| 45 | link_args: dynamic_linker, |
| 46 | build_rpath: get_option('oe-sdk').enabled() ? rpath : '', |
Deepak Kodihalli | 4de4d00 | 2019-11-11 02:41:43 -0600 | [diff] [blame] | 47 | dependencies: [ |
| 48 | libpldm, |
| 49 | libpldmresponder, |
| 50 | gtest, |
| 51 | gmock, |
| 52 | pldmd, |
| 53 | dependency('phosphor-dbus-interfaces'), |
| 54 | dependency('phosphor-logging'), |
| 55 | dependency('sdbusplus')]), |
Deepak Kodihalli | 3c275e1 | 2019-09-21 06:39:39 -0500 | [diff] [blame] | 56 | workdir: meson.current_source_dir()) |
| 57 | endforeach |