2019-02-25 16:50:10 +00:00
|
|
|
nunit_console = find_program('nunit-console', 'nunitlite-runner', required: get_option('tests'))
|
2018-03-15 10:23:58 +00:00
|
|
|
|
|
|
|
if nunit_console.found()
|
|
|
|
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(),
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-02-25 16:50:10 +00:00
|
|
|
nunit_dep = dependency('mono-nunit')
|
|
|
|
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()
|
|
|
|
testsenv.prepend('MONO_PATH',
|
|
|
|
join_paths(meson.build_root(), path.strip('-r:'), '..'))
|
|
|
|
endforeach
|
2018-03-15 10:23:58 +00:00
|
|
|
|
2019-02-25 16:50:10 +00:00
|
|
|
nunit_dep = declare_dependency(link_args: get_nunit_res.stdout().split(),
|
|
|
|
version: nunit_version)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
if nunit_dep.found()
|
2018-03-15 10:23:58 +00:00
|
|
|
foreach test: [
|
|
|
|
# 'PipelineTests',
|
|
|
|
'SdpTests'
|
|
|
|
]
|
2018-03-24 14:30:40 +00:00
|
|
|
lib = shared_library(test, test + '.cs', 'TestBase.cs',
|
2018-03-15 10:23:58 +00:00
|
|
|
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114'],
|
|
|
|
dependencies: [gst_sharp_dep, nunit_dep])
|
|
|
|
test(test, nunit_console, args: [lib.full_path()], env: testsenv)
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
message('Could not find nunit-console, can\'t run unitests')
|
|
|
|
endif
|