libvirt/scripts/rpcgen/tests/meson.build
Michal Privoznik dec02f101e rpcgen: tests: Allow running test_demo from anywhere
The test_demo program compares whether XDR encoded data match the
expected output as read from a file. But the file path is not
absolute and thus relative to CWD which means the program can run
only from one specific directory.

Do what we do in the rest of our test suite: define 'abs_srcdir'
macro and prefix the path with it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2023-11-29 14:34:11 +01:00

24 lines
412 B
Meson

rpcgen_tests = files([
'test_generator.py',
'test_lexer.py',
'test_parser.py',
])
test_demo = executable(
'test_demo',
[ 'test_demo.c' ],
c_args: [
'-Dabs_srcdir="@0@"'.format(meson.current_source_dir()),
] + cc_flags_relaxed_frame_limit,
dependencies: [
xdr_dep, glib_dep
],
)
test(
'test_demo',
test_demo,
workdir: meson.current_source_dir(),
)