mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-25 21:46:14 +01:00
Merge branch 'wip/3v1n0/meson-fix-tests-binary-dependencies' into 'main'
test/meson: Add tests dependencies on built programs, libraries and modules See merge request GNOME/glib!3015
This commit is contained in:
commit
e2b9e28ece
@ -139,7 +139,6 @@ debian-stable-x86_64:
|
|||||||
--libdir=lib
|
--libdir=lib
|
||||||
-Dsystemtap=true
|
-Dsystemtap=true
|
||||||
-Ddtrace=true
|
-Ddtrace=true
|
||||||
-Dinstalled_tests=true
|
|
||||||
_build
|
_build
|
||||||
- ninja -C _build
|
- ninja -C _build
|
||||||
- .gitlab-ci/run-tests.sh
|
- .gitlab-ci/run-tests.sh
|
||||||
|
@ -56,12 +56,7 @@ test_launch (void)
|
|||||||
|
|
||||||
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
||||||
appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (path);
|
appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (path);
|
||||||
|
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||||
if (appinfo == NULL)
|
|
||||||
{
|
|
||||||
g_test_skip ("appinfo-test binary not installed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
test_launch_for_app_info (appinfo);
|
test_launch_for_app_info (appinfo);
|
||||||
g_object_unref (appinfo);
|
g_object_unref (appinfo);
|
||||||
@ -220,12 +215,7 @@ test_show_in (void)
|
|||||||
|
|
||||||
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
||||||
appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (path);
|
appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (path);
|
||||||
|
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||||
if (appinfo == NULL)
|
|
||||||
{
|
|
||||||
g_test_skip ("appinfo-test binary not installed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_assert_true (g_app_info_should_show (appinfo));
|
g_assert_true (g_app_info_should_show (appinfo));
|
||||||
g_object_unref (appinfo);
|
g_object_unref (appinfo);
|
||||||
|
@ -687,6 +687,7 @@ run_apps (const gchar *command,
|
|||||||
argv[2] = g_strdup (arg);
|
argv[2] = g_strdup (arg);
|
||||||
argv[3] = NULL;
|
argv[3] = NULL;
|
||||||
|
|
||||||
|
g_assert_true (g_file_test (argv[0], G_FILE_TEST_IS_EXECUTABLE));
|
||||||
envp = g_get_environ ();
|
envp = g_get_environ ();
|
||||||
|
|
||||||
if (with_usr)
|
if (with_usr)
|
||||||
@ -1084,12 +1085,7 @@ test_launch_as_manager (void)
|
|||||||
|
|
||||||
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
||||||
appinfo = g_desktop_app_info_new_from_filename (path);
|
appinfo = g_desktop_app_info_new_from_filename (path);
|
||||||
|
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||||
if (appinfo == NULL)
|
|
||||||
{
|
|
||||||
g_test_skip ("appinfo-test binary not installed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
context = g_object_new (test_launch_context_get_type (), NULL);
|
context = g_object_new (test_launch_context_get_type (), NULL);
|
||||||
g_signal_connect (context, "launch-started",
|
g_signal_connect (context, "launch-started",
|
||||||
@ -1147,12 +1143,7 @@ test_launch_as_manager_fail (void)
|
|||||||
|
|
||||||
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
||||||
appinfo = g_desktop_app_info_new_from_filename (path);
|
appinfo = g_desktop_app_info_new_from_filename (path);
|
||||||
|
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||||
if (appinfo == NULL)
|
|
||||||
{
|
|
||||||
g_test_skip ("appinfo-test binary not installed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
context = g_object_new (test_launch_context_get_type (), NULL);
|
context = g_object_new (test_launch_context_get_type (), NULL);
|
||||||
g_signal_connect (context, "launch-started",
|
g_signal_connect (context, "launch-started",
|
||||||
|
@ -42,6 +42,10 @@ giotypefuncs_inc = custom_target(
|
|||||||
input : gio_headers + [gioenumtypes_h] + gobject_install_headers,
|
input : gio_headers + [gioenumtypes_h] + gobject_install_headers,
|
||||||
command: [gengiotypefuncs_prog, '@OUTPUT@', '@INPUT@'])
|
command: [gengiotypefuncs_prog, '@OUTPUT@', '@INPUT@'])
|
||||||
|
|
||||||
|
if glib_build_shared
|
||||||
|
subdir('modules')
|
||||||
|
endif
|
||||||
|
|
||||||
# Test programs buildable on all platforms
|
# Test programs buildable on all platforms
|
||||||
gio_tests = {
|
gio_tests = {
|
||||||
'appmonitor' : {
|
'appmonitor' : {
|
||||||
@ -66,9 +70,12 @@ gio_tests = {
|
|||||||
'file-thumbnail' : {},
|
'file-thumbnail' : {},
|
||||||
'fileattributematcher' : {},
|
'fileattributematcher' : {},
|
||||||
'filter-streams' : {},
|
'filter-streams' : {},
|
||||||
'giomodule' : {},
|
'giomodule' : {
|
||||||
|
'depends' : glib_build_shared ? [libtestmodulea, libtestmoduleb] : [],
|
||||||
|
},
|
||||||
'gsubprocess' : {
|
'gsubprocess' : {
|
||||||
'suite': host_system == 'windows' ? ['flaky'] : [],
|
'suite': host_system == 'windows' ? ['flaky'] : [],
|
||||||
|
'extra_programs': ['gsubprocess-testprog'],
|
||||||
},
|
},
|
||||||
'g-file' : {},
|
'g-file' : {},
|
||||||
'g-file-info' : {
|
'g-file-info' : {
|
||||||
@ -125,6 +132,7 @@ gio_tests = {
|
|||||||
'tls-bindings' : {'extra_sources' : ['gtesttlsbackend.c']},
|
'tls-bindings' : {'extra_sources' : ['gtesttlsbackend.c']},
|
||||||
'unix-fd' : {},
|
'unix-fd' : {},
|
||||||
'gdbus-address-get-session' : {
|
'gdbus-address-get-session' : {
|
||||||
|
'extra_programs': host_system != 'windows' ? ['dbus-launch'] : [],
|
||||||
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
||||||
'can_fail' : host_system == 'darwin',
|
'can_fail' : host_system == 'darwin',
|
||||||
},
|
},
|
||||||
@ -259,9 +267,12 @@ if host_machine.system() != 'windows'
|
|||||||
gio_tests += {
|
gio_tests += {
|
||||||
'appinfo' : {
|
'appinfo' : {
|
||||||
'install' : false,
|
'install' : false,
|
||||||
|
'extra_programs' : ['appinfo-test'],
|
||||||
},
|
},
|
||||||
'desktop-app-info' : {
|
'desktop-app-info' : {
|
||||||
'install' : false,
|
'install' : false,
|
||||||
|
'depends' : gio_launch_desktop,
|
||||||
|
'extra_programs' : ['apps', 'appinfo-test'],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
@ -347,6 +358,7 @@ if host_machine.system() != 'windows'
|
|||||||
]
|
]
|
||||||
|
|
||||||
extra_sources = ['gdbus-sessionbus.c', 'gdbus-tests.c']
|
extra_sources = ['gdbus-sessionbus.c', 'gdbus-tests.c']
|
||||||
|
extra_programs = ['gdbus-testserver']
|
||||||
|
|
||||||
gio_tests += {
|
gio_tests += {
|
||||||
'actions' : {
|
'actions' : {
|
||||||
@ -356,31 +368,56 @@ if host_machine.system() != 'windows'
|
|||||||
'gdbus-auth' : {'extra_sources' : extra_sources},
|
'gdbus-auth' : {'extra_sources' : extra_sources},
|
||||||
'gdbus-bz627724' : {'extra_sources' : extra_sources},
|
'gdbus-bz627724' : {'extra_sources' : extra_sources},
|
||||||
'gdbus-close-pending' : {'extra_sources' : extra_sources},
|
'gdbus-close-pending' : {'extra_sources' : extra_sources},
|
||||||
'gdbus-connection' : {'extra_sources' : extra_sources},
|
'gdbus-connection' : {
|
||||||
'gdbus-connection-loss' : {'extra_sources' : extra_sources},
|
'extra_sources' : extra_sources,
|
||||||
'gdbus-connection-slow' : {'extra_sources' : extra_sources},
|
'extra_programs': extra_programs,
|
||||||
|
},
|
||||||
|
'gdbus-connection-loss' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': extra_programs,
|
||||||
|
},
|
||||||
|
'gdbus-connection-slow' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': extra_programs + ['gdbus-connection-flush-helper'],
|
||||||
|
},
|
||||||
'gdbus-error' : {'extra_sources' : extra_sources},
|
'gdbus-error' : {'extra_sources' : extra_sources},
|
||||||
'gdbus-exit-on-close' : {'extra_sources' : extra_sources},
|
'gdbus-exit-on-close' : {'extra_sources' : extra_sources},
|
||||||
'gdbus-export' : {
|
'gdbus-export' : {
|
||||||
'extra_sources' : extra_sources,
|
'extra_sources' : extra_sources,
|
||||||
'suite' : ['slow'],
|
'suite' : ['slow'],
|
||||||
},
|
},
|
||||||
'gdbus-introspection' : {'extra_sources' : extra_sources},
|
'gdbus-introspection' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': extra_programs,
|
||||||
|
},
|
||||||
'gdbus-method-invocation' : {'extra_sources' : extra_sources},
|
'gdbus-method-invocation' : {'extra_sources' : extra_sources},
|
||||||
'gdbus-names' : {'extra_sources' : extra_sources},
|
'gdbus-names' : {
|
||||||
'gdbus-proxy' : {'extra_sources' : extra_sources},
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs' : ['fake-service-name'],
|
||||||
|
},
|
||||||
|
'gdbus-proxy' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': extra_programs,
|
||||||
|
},
|
||||||
'gdbus-proxy-threads' : {
|
'gdbus-proxy-threads' : {
|
||||||
'extra_sources' : extra_sources,
|
'extra_sources' : extra_sources,
|
||||||
'dependencies' : [dbus1_dep],
|
'dependencies' : [dbus1_dep],
|
||||||
},
|
},
|
||||||
'gdbus-proxy-unique-name' : {'extra_sources' : extra_sources},
|
'gdbus-proxy-unique-name' : {
|
||||||
'gdbus-proxy-well-known-name' : {'extra_sources' : extra_sources},
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': extra_programs,
|
||||||
|
},
|
||||||
|
'gdbus-proxy-well-known-name' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': extra_programs,
|
||||||
|
},
|
||||||
'gdbus-test-codegen' : {
|
'gdbus-test-codegen' : {
|
||||||
'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
|
'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
|
||||||
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
|
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
|
||||||
},
|
},
|
||||||
'gdbus-threading' : {
|
'gdbus-threading' : {
|
||||||
'extra_sources' : extra_sources,
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': extra_programs,
|
||||||
'suite' : ['slow'],
|
'suite' : ['slow'],
|
||||||
},
|
},
|
||||||
'gmenumodel' : {
|
'gmenumodel' : {
|
||||||
@ -401,13 +438,17 @@ if host_machine.system() != 'windows'
|
|||||||
'extra_sources' : [extra_sources, gdbus_test_codegen_generated_min_required_2_64, gdbus_test_codegen_generated_interface_info],
|
'extra_sources' : [extra_sources, gdbus_test_codegen_generated_min_required_2_64, gdbus_test_codegen_generated_interface_info],
|
||||||
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_64'],
|
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_64'],
|
||||||
},
|
},
|
||||||
'gapplication' : {'extra_sources' : extra_sources},
|
'gapplication' : {
|
||||||
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs': ['basic-application'],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if not glib_have_cocoa
|
if not glib_have_cocoa
|
||||||
gio_tests += {
|
gio_tests += {
|
||||||
'dbus-appinfo' : {
|
'dbus-appinfo' : {
|
||||||
'extra_sources' : extra_sources,
|
'extra_sources' : extra_sources,
|
||||||
|
'extra_programs' : ['fake-document-portal'],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
@ -459,6 +500,7 @@ if host_machine.system() != 'windows'
|
|||||||
'c_args' : ['-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
'c_args' : ['-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
||||||
'-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir)],
|
'-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir)],
|
||||||
'install' : false,
|
'install' : false,
|
||||||
|
'depends' : glib_compile_schemas,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
@ -544,33 +586,36 @@ if host_machine.system() != 'windows'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
appinfo_test_desktop_files = [
|
appinfo_test_desktop_files = [
|
||||||
'appinfo-test-gnome.desktop',
|
'appinfo-test-gnome',
|
||||||
'appinfo-test-notgnome.desktop',
|
'appinfo-test-notgnome',
|
||||||
'appinfo-test.desktop',
|
'appinfo-test',
|
||||||
'appinfo-test2.desktop',
|
'appinfo-test2',
|
||||||
]
|
]
|
||||||
|
|
||||||
cdata = configuration_data()
|
|
||||||
if installed_tests_enabled
|
|
||||||
cdata.set('installed_tests_dir', installed_tests_execdir)
|
|
||||||
else
|
|
||||||
cdata.set('installed_tests_dir', meson.current_build_dir())
|
|
||||||
endif
|
|
||||||
|
|
||||||
foreach appinfo_test_desktop_file : appinfo_test_desktop_files
|
foreach appinfo_test_desktop_file : appinfo_test_desktop_files
|
||||||
|
input_desktop_file = appinfo_test_desktop_file + '.desktop.in'
|
||||||
|
output_desktop_file = appinfo_test_desktop_file + '.desktop'
|
||||||
|
configure_file(
|
||||||
|
input: input_desktop_file,
|
||||||
|
output: output_desktop_file,
|
||||||
|
configuration: {
|
||||||
|
'installed_tests_dir' : meson.current_build_dir(),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
if installed_tests_enabled
|
if installed_tests_enabled
|
||||||
configure_file(
|
installed_desktop = configure_file(
|
||||||
input: appinfo_test_desktop_file + '.in',
|
input: input_desktop_file,
|
||||||
output: appinfo_test_desktop_file,
|
output: appinfo_test_desktop_file + '-installed.desktop',
|
||||||
|
configuration: {
|
||||||
|
'installed_tests_dir' : installed_tests_execdir,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
install_data(installed_desktop,
|
||||||
install_dir: installed_tests_execdir,
|
install_dir: installed_tests_execdir,
|
||||||
install_tag: 'tests',
|
install_tag: 'tests',
|
||||||
configuration: cdata,
|
rename: output_desktop_file,
|
||||||
)
|
|
||||||
else
|
|
||||||
configure_file(
|
|
||||||
input: appinfo_test_desktop_file + '.in',
|
|
||||||
output: appinfo_test_desktop_file,
|
|
||||||
configuration: cdata,
|
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
@ -657,6 +702,7 @@ endif
|
|||||||
|
|
||||||
if meson.can_run_host_binaries()
|
if meson.can_run_host_binaries()
|
||||||
|
|
||||||
|
resource_plugin = []
|
||||||
compiler_type = '--compiler=@0@'.format(cc.get_id())
|
compiler_type = '--compiler=@0@'.format(cc.get_id())
|
||||||
|
|
||||||
if glib_build_shared
|
if glib_build_shared
|
||||||
@ -672,7 +718,8 @@ if meson.can_run_host_binaries()
|
|||||||
'--c-name', '_g_plugin',
|
'--c-name', '_g_plugin',
|
||||||
'@INPUT@'])
|
'@INPUT@'])
|
||||||
|
|
||||||
shared_module('resourceplugin', 'resourceplugin.c', plugin_resources_c,
|
resource_plugin += shared_module('resourceplugin',
|
||||||
|
sources: ['resourceplugin.c', plugin_resources_c],
|
||||||
link_args : export_dynamic_ldflags,
|
link_args : export_dynamic_ldflags,
|
||||||
dependencies : common_gio_tests_deps,
|
dependencies : common_gio_tests_deps,
|
||||||
install_dir : installed_tests_execdir,
|
install_dir : installed_tests_execdir,
|
||||||
@ -865,10 +912,28 @@ if meson.can_run_host_binaries()
|
|||||||
gio_tests += {
|
gio_tests += {
|
||||||
'resources' : {
|
'resources' : {
|
||||||
'extra_sources' : resources_extra_sources,
|
'extra_sources' : resources_extra_sources,
|
||||||
|
'depends' : resource_plugin,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
test_extra_programs_targets = {}
|
||||||
|
foreach program_name, extra_args : test_extra_programs
|
||||||
|
source = extra_args.get('source', program_name + '.c')
|
||||||
|
extra_sources = extra_args.get('extra_sources', [])
|
||||||
|
install = installed_tests_enabled and extra_args.get('install', true)
|
||||||
|
test_extra_programs_targets += {
|
||||||
|
program_name : executable(program_name,
|
||||||
|
sources: [source, extra_sources],
|
||||||
|
c_args : test_c_args,
|
||||||
|
dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
|
||||||
|
install_dir : installed_tests_execdir,
|
||||||
|
install_tag : 'tests',
|
||||||
|
install : install,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
endforeach
|
||||||
|
|
||||||
foreach test_name, extra_args : gio_tests
|
foreach test_name, extra_args : gio_tests
|
||||||
source = extra_args.get('source', test_name + '.c')
|
source = extra_args.get('source', test_name + '.c')
|
||||||
extra_sources = extra_args.get('extra_sources', [])
|
extra_sources = extra_args.get('extra_sources', [])
|
||||||
@ -910,6 +975,11 @@ foreach test_name, extra_args : gio_tests
|
|||||||
suite = ['gio'] + extra_args.get('suite', [])
|
suite = ['gio'] + extra_args.get('suite', [])
|
||||||
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
||||||
local_test_env = test_env
|
local_test_env = test_env
|
||||||
|
depends = [extra_args.get('depends', [])]
|
||||||
|
|
||||||
|
foreach program : extra_args.get('extra_programs', [])
|
||||||
|
depends += test_extra_programs_targets[program]
|
||||||
|
endforeach
|
||||||
|
|
||||||
foreach var, value : extra_args.get('env', {})
|
foreach var, value : extra_args.get('env', {})
|
||||||
local_test_env.append(var, value)
|
local_test_env.append(var, value)
|
||||||
@ -924,34 +994,27 @@ foreach test_name, extra_args : gio_tests
|
|||||||
timeout : timeout,
|
timeout : timeout,
|
||||||
suite : suite,
|
suite : suite,
|
||||||
is_parallel : extra_args.get('is_parallel', true),
|
is_parallel : extra_args.get('is_parallel', true),
|
||||||
depends : extra_args.get('depends', []),
|
depends : depends,
|
||||||
should_fail : extra_args.get('should_fail', false),
|
should_fail : extra_args.get('should_fail', false),
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
foreach program_name, extra_args : test_extra_programs
|
|
||||||
source = extra_args.get('source', program_name + '.c')
|
|
||||||
extra_sources = extra_args.get('extra_sources', [])
|
|
||||||
install = installed_tests_enabled and extra_args.get('install', true)
|
|
||||||
executable(program_name, [source, extra_sources],
|
|
||||||
c_args : test_c_args,
|
|
||||||
dependencies : common_gio_tests_deps + extra_args.get('dependencies', []),
|
|
||||||
install_dir : installed_tests_execdir,
|
|
||||||
install_tag : 'tests',
|
|
||||||
install : install,
|
|
||||||
)
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
foreach test_name, extra_args : python_tests
|
foreach test_name, extra_args : python_tests
|
||||||
|
depends = [extra_args.get('depends', [])]
|
||||||
suite = ['gio', 'no-valgrind']
|
suite = ['gio', 'no-valgrind']
|
||||||
|
|
||||||
if extra_args.get('can_fail', false)
|
if extra_args.get('can_fail', false)
|
||||||
suite += 'failing'
|
suite += 'failing'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
foreach program : extra_args.get('extra_programs', [])
|
||||||
|
depends += test_extra_programs_targets[program]
|
||||||
|
endforeach
|
||||||
|
|
||||||
test(
|
test(
|
||||||
test_name,
|
test_name,
|
||||||
python,
|
python,
|
||||||
|
depends: depends,
|
||||||
args: ['-B', files(test_name)],
|
args: ['-B', files(test_name)],
|
||||||
env: test_env,
|
env: test_env,
|
||||||
suite: suite,
|
suite: suite,
|
||||||
@ -989,7 +1052,3 @@ if installed_tests_enabled
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('services')
|
subdir('services')
|
||||||
|
|
||||||
if glib_build_shared
|
|
||||||
subdir('modules')
|
|
||||||
endif
|
|
||||||
|
@ -115,18 +115,30 @@ glib_tests = {
|
|||||||
'spawn-multithreaded' : {
|
'spawn-multithreaded' : {
|
||||||
'can_fail': glib_build_static and host_system == 'windows',
|
'can_fail': glib_build_static and host_system == 'windows',
|
||||||
'suite': host_system == 'windows' ? ['flaky'] : [],
|
'suite': host_system == 'windows' ? ['flaky'] : [],
|
||||||
|
'extra_programs' : ['test-spawn-echo'] + (
|
||||||
|
host_machine.system() == 'windows' ? ['test-spawn-sleep'] : []),
|
||||||
|
},
|
||||||
|
'spawn-path-search' : {
|
||||||
|
'extra_programs' : [
|
||||||
|
'spawn-path-search-helper',
|
||||||
|
'spawn-test-helper',
|
||||||
|
'spawn-test-helper-subdir',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'spawn-path-search' : {},
|
|
||||||
'spawn-singlethread' : {
|
'spawn-singlethread' : {
|
||||||
'dependencies' : [winsock2],
|
'dependencies' : [winsock2],
|
||||||
|
'extra_programs' : ['test-spawn-echo'],
|
||||||
},
|
},
|
||||||
'spawn-test' : {
|
'spawn-test' : {
|
||||||
'can_fail': host_system == 'windows' and cc.get_id() == 'gcc',
|
'can_fail': host_system == 'windows' and cc.get_id() == 'gcc',
|
||||||
|
'extra_programs' : host_machine.system() == 'windows' ? ['spawn-test-win32-gui'] : [],
|
||||||
},
|
},
|
||||||
'strfuncs' : {},
|
'strfuncs' : {},
|
||||||
'string' : {},
|
'string' : {},
|
||||||
'strvbuilder' : {},
|
'strvbuilder' : {},
|
||||||
'testing' : {},
|
'testing' : {
|
||||||
|
'extra_programs' : ['testing-helper'],
|
||||||
|
},
|
||||||
'test-printf' : {},
|
'test-printf' : {},
|
||||||
'thread' : {},
|
'thread' : {},
|
||||||
'thread-deprecated' : {},
|
'thread-deprecated' : {},
|
||||||
@ -265,6 +277,23 @@ if installed_tests_enabled
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
test_extra_programs = {
|
||||||
|
'assert-msg-test' : {},
|
||||||
|
'spawn-path-search-helper' : {},
|
||||||
|
'spawn-test-helper' : {},
|
||||||
|
'testing-helper' : {},
|
||||||
|
# test-spawn-echo helper binary required by the spawn tests above
|
||||||
|
'test-spawn-echo' : {},
|
||||||
|
}
|
||||||
|
|
||||||
|
if host_machine.system() == 'windows'
|
||||||
|
# test-spawn-sleep helper binary required by the spawn tests above
|
||||||
|
test_extra_programs += {
|
||||||
|
'test-spawn-sleep' : {},
|
||||||
|
'spawn-test-win32-gui' : { 'win_subsystem': 'windows' },
|
||||||
|
}
|
||||||
|
endif
|
||||||
|
|
||||||
test_env = environment()
|
test_env = environment()
|
||||||
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
||||||
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
||||||
@ -273,6 +302,27 @@ test_deps = [libm, thread_dep, libglib_dep]
|
|||||||
test_cargs = ['-DG_LOG_DOMAIN="GLib"', '-UG_DISABLE_ASSERT']
|
test_cargs = ['-DG_LOG_DOMAIN="GLib"', '-UG_DISABLE_ASSERT']
|
||||||
test_cpp_args = test_cargs
|
test_cpp_args = test_cargs
|
||||||
|
|
||||||
|
test_extra_programs_targets = {}
|
||||||
|
foreach program_name, extra_args : test_extra_programs
|
||||||
|
source = extra_args.get('source', program_name + '.c')
|
||||||
|
extra_sources = extra_args.get('extra_sources', [])
|
||||||
|
install = installed_tests_enabled and extra_args.get('install', true)
|
||||||
|
test_extra_programs_targets += {
|
||||||
|
program_name : executable(program_name,
|
||||||
|
sources: [source, extra_sources],
|
||||||
|
c_args : test_cargs,
|
||||||
|
cpp_args: test_cpp_args,
|
||||||
|
dependencies : test_deps + extra_args.get('dependencies', []),
|
||||||
|
install_dir : installed_tests_execdir,
|
||||||
|
install_tag : 'tests',
|
||||||
|
install : install,
|
||||||
|
win_subsystem : extra_args.get('win_subsystem', 'console'),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
subdir('path-test-subdir')
|
||||||
|
|
||||||
foreach test_name, extra_args : glib_tests
|
foreach test_name, extra_args : glib_tests
|
||||||
source = extra_args.get('source', test_name + '.c')
|
source = extra_args.get('source', test_name + '.c')
|
||||||
install = installed_tests_enabled and extra_args.get('install', true)
|
install = installed_tests_enabled and extra_args.get('install', true)
|
||||||
@ -301,6 +351,7 @@ foreach test_name, extra_args : glib_tests
|
|||||||
install: install,
|
install: install,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
depends = [extra_args.get('depends', [])]
|
||||||
suite = ['glib'] + extra_args.get('suite', [])
|
suite = ['glib'] + extra_args.get('suite', [])
|
||||||
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
||||||
|
|
||||||
@ -308,7 +359,12 @@ foreach test_name, extra_args : glib_tests
|
|||||||
suite += 'failing'
|
suite += 'failing'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
foreach program : extra_args.get('extra_programs', [])
|
||||||
|
depends += test_extra_programs_targets[program]
|
||||||
|
endforeach
|
||||||
|
|
||||||
test(test_name, exe,
|
test(test_name, exe,
|
||||||
|
depends : depends,
|
||||||
env : test_env,
|
env : test_env,
|
||||||
timeout : timeout,
|
timeout : timeout,
|
||||||
suite : suite,
|
suite : suite,
|
||||||
@ -327,28 +383,26 @@ endif
|
|||||||
python_tests = {
|
python_tests = {
|
||||||
'assert-msg-test.py' : {
|
'assert-msg-test.py' : {
|
||||||
'can_fail' : host_system == 'windows',
|
'can_fail' : host_system == 'windows',
|
||||||
|
'extra_programs': ['assert-msg-test'],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
executable('assert-msg-test', ['assert-msg-test.c'],
|
|
||||||
c_args : test_cargs,
|
|
||||||
dependencies : test_deps,
|
|
||||||
install_dir : installed_tests_execdir,
|
|
||||||
install_tag : 'tests',
|
|
||||||
install : installed_tests_enabled,
|
|
||||||
win_subsystem : extra_args.get('win_subsystem', 'console'),
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach test_name, extra_args : python_tests
|
foreach test_name, extra_args : python_tests
|
||||||
|
depends = [extra_args.get('depends', [])]
|
||||||
suite = ['glib', 'no-valgrind']
|
suite = ['glib', 'no-valgrind']
|
||||||
|
|
||||||
if extra_args.get('can_fail', false)
|
if extra_args.get('can_fail', false)
|
||||||
suite += 'failing'
|
suite += 'failing'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
foreach program : extra_args.get('extra_programs', [])
|
||||||
|
depends += test_extra_programs_targets[program]
|
||||||
|
endforeach
|
||||||
|
|
||||||
test(
|
test(
|
||||||
test_name,
|
test_name,
|
||||||
python,
|
python,
|
||||||
|
depends: depends,
|
||||||
args: ['-B', files(test_name)],
|
args: ['-B', files(test_name)],
|
||||||
env: test_env,
|
env: test_env,
|
||||||
suite: suite,
|
suite: suite,
|
||||||
@ -376,58 +430,6 @@ foreach test_name, extra_args : python_tests
|
|||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
executable('spawn-path-search-helper', 'spawn-path-search-helper.c',
|
|
||||||
c_args : test_cargs,
|
|
||||||
dependencies : test_deps,
|
|
||||||
install_dir: installed_tests_execdir,
|
|
||||||
install_tag: 'tests',
|
|
||||||
install: installed_tests_enabled,
|
|
||||||
)
|
|
||||||
|
|
||||||
executable('spawn-test-helper', 'spawn-test-helper.c',
|
|
||||||
c_args : test_cargs,
|
|
||||||
dependencies : test_deps,
|
|
||||||
install_dir: installed_tests_execdir,
|
|
||||||
install_tag: 'tests',
|
|
||||||
install: installed_tests_enabled,
|
|
||||||
)
|
|
||||||
|
|
||||||
# test-spawn-echo helper binary required by the spawn tests above
|
|
||||||
executable('test-spawn-echo', 'test-spawn-echo.c',
|
|
||||||
c_args : test_cargs,
|
|
||||||
dependencies : test_deps,
|
|
||||||
install_dir: installed_tests_execdir,
|
|
||||||
install_tag: 'tests',
|
|
||||||
install: installed_tests_enabled,
|
|
||||||
)
|
|
||||||
|
|
||||||
if host_machine.system() == 'windows'
|
|
||||||
# test-spawn-sleep helper binary required by the spawn tests above
|
|
||||||
executable('test-spawn-sleep', 'test-spawn-sleep.c',
|
|
||||||
c_args : test_cargs,
|
|
||||||
dependencies : test_deps,
|
|
||||||
install_dir: installed_tests_execdir,
|
|
||||||
install_tag: 'tests',
|
|
||||||
install: installed_tests_enabled,
|
|
||||||
)
|
|
||||||
executable('spawn-test-win32-gui', 'spawn-test-win32-gui.c',
|
|
||||||
c_args : test_cargs,
|
|
||||||
dependencies : test_deps,
|
|
||||||
install_dir: installed_tests_execdir,
|
|
||||||
install_tag: 'tests',
|
|
||||||
install: installed_tests_enabled,
|
|
||||||
win_subsystem: 'windows',
|
|
||||||
)
|
|
||||||
endif
|
|
||||||
|
|
||||||
executable('testing-helper', 'testing-helper.c',
|
|
||||||
c_args : test_cargs,
|
|
||||||
dependencies : test_deps,
|
|
||||||
install_dir: installed_tests_execdir,
|
|
||||||
install_tag: 'tests',
|
|
||||||
install: installed_tests_enabled,
|
|
||||||
)
|
|
||||||
|
|
||||||
# some testing of gtester functionality
|
# some testing of gtester functionality
|
||||||
if meson.can_run_host_binaries() and host_system != 'windows'
|
if meson.can_run_host_binaries() and host_system != 'windows'
|
||||||
xmllint = find_program('xmllint', required: false)
|
xmllint = find_program('xmllint', required: false)
|
||||||
@ -445,4 +447,3 @@ if meson.can_run_host_binaries() and host_system != 'windows'
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('path-test-subdir')
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
executable('spawn-test-helper', 'spawn-test-helper.c',
|
test_extra_programs_targets += {
|
||||||
c_args : test_cargs,
|
'spawn-test-helper-subdir' : executable('spawn-test-helper',
|
||||||
dependencies : test_deps,
|
sources: 'spawn-test-helper.c',
|
||||||
install_dir: join_paths(installed_tests_execdir, 'path-test-subdir'),
|
c_args : test_cargs,
|
||||||
install_tag: 'tests',
|
dependencies : test_deps,
|
||||||
install: installed_tests_enabled,
|
install_dir: installed_tests_execdir / 'path-test-subdir',
|
||||||
)
|
install_tag: 'tests',
|
||||||
|
install: installed_tests_enabled,
|
||||||
|
),
|
||||||
|
}
|
||||||
|
@ -33,7 +33,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
static char *echo_prog_path;
|
static char *echo_prog_path;
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
static char *sleep_prog_path;
|
static char *sleep_prog_path;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -425,14 +428,15 @@ main (int argc,
|
|||||||
|
|
||||||
dirname = g_path_get_dirname (argv[0]);
|
dirname = g_path_get_dirname (argv[0]);
|
||||||
echo_prog_path = g_build_filename (dirname, "test-spawn-echo" EXEEXT, NULL);
|
echo_prog_path = g_build_filename (dirname, "test-spawn-echo" EXEEXT, NULL);
|
||||||
sleep_prog_path = g_build_filename (dirname, "test-spawn-sleep" EXEEXT, NULL);
|
|
||||||
g_free (dirname);
|
|
||||||
|
|
||||||
g_assert (g_file_test (echo_prog_path, G_FILE_TEST_EXISTS));
|
g_assert (g_file_test (echo_prog_path, G_FILE_TEST_EXISTS));
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
|
sleep_prog_path = g_build_filename (dirname, "test-spawn-sleep" EXEEXT, NULL);
|
||||||
g_assert (g_file_test (sleep_prog_path, G_FILE_TEST_EXISTS));
|
g_assert (g_file_test (sleep_prog_path, G_FILE_TEST_EXISTS));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_clear_pointer (&dirname, g_free);
|
||||||
|
|
||||||
g_test_add_func ("/gthread/spawn-childs", test_spawn_childs);
|
g_test_add_func ("/gthread/spawn-childs", test_spawn_childs);
|
||||||
g_test_add_func ("/gthread/spawn-childs-threads", test_spawn_childs_threads);
|
g_test_add_func ("/gthread/spawn-childs-threads", test_spawn_childs_threads);
|
||||||
g_test_add_func ("/gthread/spawn-sync", test_spawn_sync_multithreaded);
|
g_test_add_func ("/gthread/spawn-sync", test_spawn_sync_multithreaded);
|
||||||
@ -441,7 +445,10 @@ main (int argc,
|
|||||||
ret = g_test_run();
|
ret = g_test_run();
|
||||||
|
|
||||||
g_free (echo_prog_path);
|
g_free (echo_prog_path);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
g_free (sleep_prog_path);
|
g_free (sleep_prog_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,5 @@
|
|||||||
gmodule_tests = {
|
gmodule_tests = {
|
||||||
'max-version' : {'install': false},
|
'max-version' : {'install': false},
|
||||||
'module-test-library' : {
|
|
||||||
'export_dynamic' : true,
|
|
||||||
'source': 'module-test.c',
|
|
||||||
'c_args': ['-DMODULE_TYPE="library"'],
|
|
||||||
'can_fail': glib_build_static and host_system == 'windows',
|
|
||||||
},
|
|
||||||
'module-test-plugin' : {
|
|
||||||
'export_dynamic' : true,
|
|
||||||
'source': 'module-test.c',
|
|
||||||
'c_args': ['-DMODULE_TYPE="plugin"'],
|
|
||||||
'can_fail': glib_build_static and host_system == 'windows',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if have_cxx
|
if have_cxx
|
||||||
@ -40,16 +28,20 @@ if ['darwin', 'ios'].contains(host_machine.system())
|
|||||||
module_suffix = 'so'
|
module_suffix = 'so'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
gmodule_test_modules = []
|
||||||
|
gmodule_test_libraries = []
|
||||||
if glib_build_shared
|
if glib_build_shared
|
||||||
foreach module : ['moduletestplugin_a', 'moduletestplugin_b']
|
foreach module : ['moduletestplugin_a', 'moduletestplugin_b']
|
||||||
shared_module(module + '_plugin', 'lib@0@.c'.format(module),
|
gmodule_test_modules += shared_module(module + '_plugin',
|
||||||
|
'lib@0@.c'.format(module),
|
||||||
dependencies : [libglib_dep, libgmodule_dep],
|
dependencies : [libglib_dep, libgmodule_dep],
|
||||||
install_dir : installed_tests_execdir,
|
install_dir : installed_tests_execdir,
|
||||||
install_tag : 'tests',
|
install_tag : 'tests',
|
||||||
install : installed_tests_enabled,
|
install : installed_tests_enabled,
|
||||||
name_suffix : module_suffix
|
name_suffix : module_suffix
|
||||||
)
|
)
|
||||||
shared_library(module + '_library', 'lib@0@.c'.format(module),
|
gmodule_test_libraries += shared_library(module + '_library',
|
||||||
|
'lib@0@.c'.format(module),
|
||||||
dependencies : [libglib_dep, libgmodule_dep],
|
dependencies : [libglib_dep, libgmodule_dep],
|
||||||
install_dir : installed_tests_execdir,
|
install_dir : installed_tests_execdir,
|
||||||
install_tag : 'tests',
|
install_tag : 'tests',
|
||||||
@ -59,6 +51,23 @@ if glib_build_shared
|
|||||||
endforeach
|
endforeach
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
gmodule_tests += {
|
||||||
|
'module-test-library' : {
|
||||||
|
'export_dynamic' : true,
|
||||||
|
'source': 'module-test.c',
|
||||||
|
'depends': gmodule_test_libraries,
|
||||||
|
'c_args': ['-DMODULE_TYPE="library"'],
|
||||||
|
'can_fail': glib_build_static_only,
|
||||||
|
},
|
||||||
|
'module-test-plugin' : {
|
||||||
|
'export_dynamic' : true,
|
||||||
|
'source': 'module-test.c',
|
||||||
|
'depends': gmodule_test_modules,
|
||||||
|
'c_args': ['-DMODULE_TYPE="plugin"'],
|
||||||
|
'can_fail': glib_build_static_only,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
test_env = environment()
|
test_env = environment()
|
||||||
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
||||||
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
||||||
@ -98,10 +107,17 @@ foreach test_name, extra_args : gmodule_tests
|
|||||||
|
|
||||||
suite = ['gmodule'] + extra_args.get('suite', [])
|
suite = ['gmodule'] + extra_args.get('suite', [])
|
||||||
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
||||||
|
depends = [extra_args.get('depends', [])]
|
||||||
|
|
||||||
if extra_args.get('can_fail', false)
|
if extra_args.get('can_fail', false)
|
||||||
suite += 'failing'
|
suite += 'failing'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test(test_name, exe, env : test_env, timeout : timeout, suite : suite)
|
test(test_name,
|
||||||
|
exe,
|
||||||
|
depends : depends,
|
||||||
|
env : test_env,
|
||||||
|
timeout : timeout,
|
||||||
|
suite : suite,
|
||||||
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
@ -170,7 +170,7 @@ libgobject_dep = declare_dependency(link_with : libgobject,
|
|||||||
)
|
)
|
||||||
meson.override_dependency('gobject-2.0', libgobject_dep)
|
meson.override_dependency('gobject-2.0', libgobject_dep)
|
||||||
|
|
||||||
executable('gobject-query', 'gobject-query.c',
|
gobject_query = executable('gobject-query', 'gobject-query.c',
|
||||||
install : true,
|
install : true,
|
||||||
install_tag : 'bin-devel',
|
install_tag : 'bin-devel',
|
||||||
dependencies : [libglib_dep, libgobject_dep])
|
dependencies : [libglib_dep, libgobject_dep])
|
||||||
|
@ -126,6 +126,7 @@ endif
|
|||||||
python_tests = {
|
python_tests = {
|
||||||
'genmarshal.py' : {},
|
'genmarshal.py' : {},
|
||||||
'gobject-query.py' : {
|
'gobject-query.py' : {
|
||||||
|
'depends' : gobject_query,
|
||||||
'can_fail' : host_system == 'windows',
|
'can_fail' : host_system == 'windows',
|
||||||
},
|
},
|
||||||
'mkenums.py' : {},
|
'mkenums.py' : {},
|
||||||
@ -183,6 +184,7 @@ foreach test_name, extra_args : gobject_tests
|
|||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
foreach test_name, extra_args : python_tests
|
foreach test_name, extra_args : python_tests
|
||||||
|
depends = [extra_args.get('depends', [])]
|
||||||
suite = ['gobject', 'no-valgrind']
|
suite = ['gobject', 'no-valgrind']
|
||||||
|
|
||||||
if extra_args.get('can_fail', false)
|
if extra_args.get('can_fail', false)
|
||||||
@ -192,6 +194,7 @@ foreach test_name, extra_args : python_tests
|
|||||||
test(
|
test(
|
||||||
test_name,
|
test_name,
|
||||||
python,
|
python,
|
||||||
|
depends: depends,
|
||||||
args: ['-B', files(test_name)],
|
args: ['-B', files(test_name)],
|
||||||
env: test_env,
|
env: test_env,
|
||||||
suite: suite,
|
suite: suite,
|
||||||
|
Loading…
Reference in New Issue
Block a user