From 291eabb6504bdc6f3ab78ea33d891f4f9693c2bb Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 4 Oct 2017 16:45:54 -0300 Subject: [PATCH] Run unit tests only when using mono and set MONO_PATH --- Source/atk/meson.build | 19 ++++++++++++------- Source/gtk/meson.build | 9 +++++++-- Source/meson.build | 11 +++++++++++ 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Source/atk/meson.build b/Source/atk/meson.build index 2fd72f9b1..dffaebaf7 100644 --- a/Source/atk/meson.build +++ b/Source/atk/meson.build @@ -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 diff --git a/Source/gtk/meson.build b/Source/gtk/meson.build index a14766bb5..9f2b1f461 100644 --- a/Source/gtk/meson.build +++ b/Source/gtk/meson.build @@ -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 diff --git a/Source/meson.build b/Source/meson.build index 59884baff..7b0884c68 100644 --- a/Source/meson.build +++ b/Source/meson.build @@ -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')