gstreamer/Tests/meson.build
Nirbheek Chauhan 23117379bc meson: Fix test failures on the CI around nunit-runner
environment().prepend() does not stack. None of the operations on that
object stack. This is documented in the Meson reference manual. Also
avoid overriding previously-set operations because that will cause
a warning in a future version of Meson.

Also, we do not need to manually construct MONO_PATH values. We can
pass an array and have Meson construct it for us.
2019-04-13 12:13:48 +05:30

53 lines
No EOL
1.9 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(),
)
nunit_mono_path = []
nunit_dep = dependency('mono-nunit', required: false, version: ['>=2.6', '< 2.7'])
if not nunit_dep.found()
if get_nunit_res.returncode() != 0
message('Failed to get NUnit: ' + get_nunit_res.stderr())
else
foreach path: get_nunit_res.stdout().split()
nunit_mono_path += [join_paths(meson.build_root(), path.strip('-r:'), '..')]
endforeach
nunit_dep = declare_dependency(link_args: get_nunit_res.stdout().split(),
version: nunit_version)
endif
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