blob: a8f9793bf02b583d58b02cc36a7ca97620c1e18b [file] [log] [blame]
SunnySrivastava19847ef54422019-12-03 02:47:37 -06001if 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
15gmock = dependency('gmock', disabler: true, required: build_tests)
16gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
17
18application_src = ['../impl.cpp']
19
20test('store_test', executable('store_test',
21 ['store/store.cpp', application_src],
22build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
23
24link_args: dynamic_linker,
25dependencies: [
26 gtest,
27 gmock,
28 sdbusplus,
29 phosphor_logging,
30 ],
31include_directories: '..'
32),
33workdir: meson.current_source_dir())
34
35vpd_test = ['ipz_parser/parser.cpp',
36 'keyword_vpd_parser_test/kw_vpd_test.cpp'
37 ]
38application_src += ['../keyword_vpd_parser.cpp',
39 '../vpdecc/vpdecc.c',
40 '../vpdecc/vpdecc_support.c'
41 ]
42foreach t : vpd_test
43 test(t, executable(t.underscorify(),
44 [t, application_src],
45 build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
46
47 link_args: dynamic_linker,
48 cpp_args: '-DIPZ_PARSER',
49 c_args: ['-Wno-unused-parameter',
50 '-Wno-unused-variable'],
51 dependencies: [
52 gtest,
53 gmock,
54 sdbusplus,
55 phosphor_logging,
56 ],
57 include_directories: '..'
58 ),
59 workdir: meson.current_source_dir())
60endforeach