Run unit tests only when using mono and set MONO_PATH

This commit is contained in:
Thibault Saunier 2017-10-04 16:45:54 -03:00 committed by Harry
parent d11000fa79
commit 291eabb650
3 changed files with 30 additions and 9 deletions

View file

@ -32,13 +32,18 @@ nuget_infos += [['AtkSharp', atk_sharp, ['GlibSharp', 'GioSharp']]]
install_infos += [assembly_name, atk_sharp.full_path()]
atk_sharp_dep = declare_dependency(link_with: [glib_sharp, atk_sharp])
if add_languages('c', required: false)
c_abi_exe = executable(assembly_name + '_c_abi', c_abi,
dependencies: [glib_dep, atk_dep])
if add_languages('c', required: false) and csc.get_id() == 'mono'
c_abi_exe = executable(assembly_name + '_c_abi', c_abi,
dependencies: [glib_dep, atk_dep])
cs_abi_exe = executable(assembly_name + '_cs_abi', cs_abi,
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'],
dependencies: [atk_sharp_dep])
cs_abi_exe = executable(assembly_name + '_cs_abi', cs_abi,
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'],
dependencies: [atk_sharp_dep])
test(assembly_name + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()])
env = environment()
env.prepend('MONO_PATH', mono_path)
test(assembly_name + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()],
env: env)
else
message('Not running tests ' + csc.get_id())
endif

View file

@ -145,7 +145,7 @@ nuget_infos += [['GtkSharp', gtk_sharp, ['GlibSharp', 'GioSharp',
install_infos += [assembly_name, gtk_sharp.full_path()]
gtk_sharp_dep = declare_dependency(link_with: deps + [gtk_sharp])
if add_languages('c', required: false)
if add_languages('c', required: false) and csc.get_id() == 'mono'
c_abi_exe = executable(assembly_name + '_c_abi', c_abi,
c_args: ['-Wno-deprecated', '-Wno-deprecated-declarations'],
dependencies: [glib_dep, gio_dep, atk_dep, gdk_dep, gtk_dep])
@ -154,5 +154,10 @@ if add_languages('c', required: false)
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'],
dependencies: [gtk_sharp_dep])
test(assembly_name + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()])
env = environment()
env.prepend('MONO_PATH', mono_path)
test(assembly_name + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()],
env: env)
else
message('Not running tests ' + csc.get_id())
endif

View file

@ -79,6 +79,12 @@ pkg_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
gapi_xml_installdir = join_paths(get_option('datadir'), 'gapi-3.0')
schema = join_paths(meson.current_source_dir(), 'gapi.xsd')
mono_path = ''
foreach d: [ 'glib', 'gio' ]
mono_path += ':' + join_paths(meson.current_build_dir(), d)
endforeach
subdir('parser')
subdir('generator')
subdir('glib')
@ -86,6 +92,7 @@ subdir('gio')
cairo_dep = dependency('cairo', required: false)
if cairo_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'cairo')
subdir('cairo')
else
message('Cairo not found, not building')
@ -93,6 +100,7 @@ endif
pango_dep = dependency('pango', required: false)
if pango_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'pango')
subdir('pango')
else
message('Pango not found, not building')
@ -100,6 +108,7 @@ endif
atk_dep = dependency('atk', required: false)
if atk_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'atk')
subdir('atk')
else
message('Atk not found, not building')
@ -107,6 +116,7 @@ endif
gdk_dep = dependency('gdk-3.0', version: gtk_required_version, required: false)
if gdk_dep.found() and atk_dep.found() and pango_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'gdk')
subdir('gdk')
has_gdk = true
else
@ -116,6 +126,7 @@ endif
gtk_dep = dependency('gtk+-3.0', version: gtk_required_version, required: false)
if gtk_dep.found() and atk_dep.found() and pango_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'gtk')
subdir('gtk')
subdir('sample/GtkDemo')
subdir('sample/valtest')