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) |
| 17 | |
| 18 | tests = [ |
| 19 | 'libpldm_base_test', |
| 20 | 'libpldm_platform_test', |
| 21 | 'libpldmresponder_base_test', |
| 22 | 'libpldm_bios_test', |
| 23 | 'libpldmresponder_bios_test', |
| 24 | 'libpldmresponder_pdr_state_effecter_test', |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 25 | 'libpldmresponder_bios_table_test', |
| 26 | 'libpldmresponder_platform_test' |
Deepak Kodihalli | 3c275e1 | 2019-09-21 06:39:39 -0500 | [diff] [blame] | 27 | ] |
| 28 | |
| 29 | if get_option('oem-ibm').enabled() |
| 30 | tests += [ |
| 31 | '../oem/ibm/test/libpldm_fileio_test', |
| 32 | '../oem/ibm/test/libpldmresponder_fileio_test' |
| 33 | ] |
| 34 | endif |
| 35 | |
| 36 | foreach t : tests |
| 37 | test(t, executable(t.underscorify(), t + '.cpp', |
| 38 | implicit_include_directories: false, |
| 39 | link_args: dynamic_linker, |
| 40 | build_rpath: get_option('oe-sdk').enabled() ? rpath : '', |
Sampa Misra | a2fa070 | 2019-05-31 01:28:55 -0500 | [diff] [blame] | 41 | dependencies: [libpldm, libpldmresponder, gtest, gmock, dependency('sdbusplus')]), |
Deepak Kodihalli | 3c275e1 | 2019-09-21 06:39:39 -0500 | [diff] [blame] | 42 | workdir: meson.current_source_dir()) |
| 43 | endforeach |