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()] install_infos += [assembly_name, atk_sharp.full_path()]
atk_sharp_dep = declare_dependency(link_with: [glib_sharp, atk_sharp]) atk_sharp_dep = declare_dependency(link_with: [glib_sharp, atk_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_abi_exe = executable(assembly_name + '_c_abi', c_abi,
dependencies: [glib_dep, atk_dep]) dependencies: [glib_dep, atk_dep])
cs_abi_exe = executable(assembly_name + '_cs_abi', cs_abi, cs_abi_exe = executable(assembly_name + '_cs_abi', cs_abi,
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'], cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'],
dependencies: [atk_sharp_dep]) 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 endif

View file

@ -145,7 +145,7 @@ nuget_infos += [['GtkSharp', gtk_sharp, ['GlibSharp', 'GioSharp',
install_infos += [assembly_name, gtk_sharp.full_path()] install_infos += [assembly_name, gtk_sharp.full_path()]
gtk_sharp_dep = declare_dependency(link_with: deps + [gtk_sharp]) 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_abi_exe = executable(assembly_name + '_c_abi', c_abi,
c_args: ['-Wno-deprecated', '-Wno-deprecated-declarations'], c_args: ['-Wno-deprecated', '-Wno-deprecated-declarations'],
dependencies: [glib_dep, gio_dep, atk_dep, gdk_dep, gtk_dep]) 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'], cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'],
dependencies: [gtk_sharp_dep]) 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 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') gapi_xml_installdir = join_paths(get_option('datadir'), 'gapi-3.0')
schema = join_paths(meson.current_source_dir(), 'gapi.xsd') 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('parser')
subdir('generator') subdir('generator')
subdir('glib') subdir('glib')
@ -86,6 +92,7 @@ subdir('gio')
cairo_dep = dependency('cairo', required: false) cairo_dep = dependency('cairo', required: false)
if cairo_dep.found() if cairo_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'cairo')
subdir('cairo') subdir('cairo')
else else
message('Cairo not found, not building') message('Cairo not found, not building')
@ -93,6 +100,7 @@ endif
pango_dep = dependency('pango', required: false) pango_dep = dependency('pango', required: false)
if pango_dep.found() if pango_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'pango')
subdir('pango') subdir('pango')
else else
message('Pango not found, not building') message('Pango not found, not building')
@ -100,6 +108,7 @@ endif
atk_dep = dependency('atk', required: false) atk_dep = dependency('atk', required: false)
if atk_dep.found() if atk_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'atk')
subdir('atk') subdir('atk')
else else
message('Atk not found, not building') message('Atk not found, not building')
@ -107,6 +116,7 @@ endif
gdk_dep = dependency('gdk-3.0', version: gtk_required_version, required: false) gdk_dep = dependency('gdk-3.0', version: gtk_required_version, required: false)
if gdk_dep.found() and atk_dep.found() and pango_dep.found() if gdk_dep.found() and atk_dep.found() and pango_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'gdk')
subdir('gdk') subdir('gdk')
has_gdk = true has_gdk = true
else else
@ -116,6 +126,7 @@ endif
gtk_dep = dependency('gtk+-3.0', version: gtk_required_version, required: false) gtk_dep = dependency('gtk+-3.0', version: gtk_required_version, required: false)
if gtk_dep.found() and atk_dep.found() and pango_dep.found() if gtk_dep.found() and atk_dep.found() and pango_dep.found()
mono_path += ':' + join_paths(meson.current_build_dir(), 'gtk')
subdir('gtk') subdir('gtk')
subdir('sample/GtkDemo') subdir('sample/GtkDemo')
subdir('sample/valtest') subdir('sample/valtest')