gstreamer/subprojects/gstreamer-sharp/Tests/meson.build
Nirbheek Chauhan 1be6d6ccf5 meson: Add explicit check: kwarg to all run_command() calls
This is required since Meson 0.61.0, and causes a warning to be
emitted otherwise:

2c079d855e
https://github.com/mesonbuild/meson/issues/9300

This exposed a bunch of places where we had broken run_command()
calls, unnecessary run_command() calls, and places where check: true
should be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1507>
2022-01-09 18:12:47 +05:30

51 lines
1.7 KiB
Meson

nunit_console = find_program('nunit-console', 'nunitlite-runner', required: get_option('tests'))
if nunit_console.found()
nunit_tests_env = environment()
# FIXME: port this to macOS and Windows
nunit_tests_env.prepend('LD_LIBRARY_PATH', testsenv_ld_library_path)
nunit_version = '3.10.1'
get_nunit_res = run_command(nuget, 'get',
'--builddir=NUnit',
'--nuget-name=NUnit',
'--nuget-version', nunit_version,
'--csharp-version=net45',
'--current-builddir', meson.current_build_dir(),
'--builddir', meson.build_root(), # FIXME: --builddir specified twice?!
check: true,
)
nunit_mono_path = []
nunit_dep = dependency('mono-nunit', required: false, version: ['>=2.6', '< 2.7'])
if not nunit_dep.found()
foreach path: get_nunit_res.stdout().split()
nunit_mono_path += [meson.build_root() / path.strip('-r:') / '..']
endforeach
nunit_dep = declare_dependency(link_args: get_nunit_res.stdout().split(),
version: nunit_version)
endif
if nunit_mono_path.length() > 0
nunit_tests_env.prepend('MONO_PATH', nunit_mono_path + mono_path)
else
nunit_tests_env.prepend('MONO_PATH', mono_path)
endif
if nunit_dep.found()
foreach test: [
# 'PipelineTests',
'SdpTests'
]
lib = shared_library(test, test + '.cs', 'TestBase.cs',
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114'],
dependencies: [gst_sharp_dep, nunit_dep])
test(test, nunit_console, args: [lib.full_path()], env: nunit_tests_env)
endforeach
endif
else
message('Could not find nunit-console, can\'t run unitests')
endif