mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16: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
|
||||
-Dsystemtap=true
|
||||
-Ddtrace=true
|
||||
-Dinstalled_tests=true
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh
|
||||
|
@ -56,12 +56,7 @@ test_launch (void)
|
||||
|
||||
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
||||
appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (path);
|
||||
|
||||
if (appinfo == NULL)
|
||||
{
|
||||
g_test_skip ("appinfo-test binary not installed");
|
||||
return;
|
||||
}
|
||||
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||
|
||||
test_launch_for_app_info (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);
|
||||
appinfo = (GAppInfo*)g_desktop_app_info_new_from_filename (path);
|
||||
|
||||
if (appinfo == NULL)
|
||||
{
|
||||
g_test_skip ("appinfo-test binary not installed");
|
||||
return;
|
||||
}
|
||||
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||
|
||||
g_assert_true (g_app_info_should_show (appinfo));
|
||||
g_object_unref (appinfo);
|
||||
|
@ -687,6 +687,7 @@ run_apps (const gchar *command,
|
||||
argv[2] = g_strdup (arg);
|
||||
argv[3] = NULL;
|
||||
|
||||
g_assert_true (g_file_test (argv[0], G_FILE_TEST_IS_EXECUTABLE));
|
||||
envp = g_get_environ ();
|
||||
|
||||
if (with_usr)
|
||||
@ -1084,12 +1085,7 @@ test_launch_as_manager (void)
|
||||
|
||||
path = g_test_get_filename (G_TEST_BUILT, "appinfo-test.desktop", NULL);
|
||||
appinfo = g_desktop_app_info_new_from_filename (path);
|
||||
|
||||
if (appinfo == NULL)
|
||||
{
|
||||
g_test_skip ("appinfo-test binary not installed");
|
||||
return;
|
||||
}
|
||||
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||
|
||||
context = g_object_new (test_launch_context_get_type (), NULL);
|
||||
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);
|
||||
appinfo = g_desktop_app_info_new_from_filename (path);
|
||||
|
||||
if (appinfo == NULL)
|
||||
{
|
||||
g_test_skip ("appinfo-test binary not installed");
|
||||
return;
|
||||
}
|
||||
g_assert_true (G_IS_APP_INFO (appinfo));
|
||||
|
||||
context = g_object_new (test_launch_context_get_type (), NULL);
|
||||
g_signal_connect (context, "launch-started",
|
||||
|
@ -42,6 +42,10 @@ giotypefuncs_inc = custom_target(
|
||||
input : gio_headers + [gioenumtypes_h] + gobject_install_headers,
|
||||
command: [gengiotypefuncs_prog, '@OUTPUT@', '@INPUT@'])
|
||||
|
||||
if glib_build_shared
|
||||
subdir('modules')
|
||||
endif
|
||||
|
||||
# Test programs buildable on all platforms
|
||||
gio_tests = {
|
||||
'appmonitor' : {
|
||||
@ -66,9 +70,12 @@ gio_tests = {
|
||||
'file-thumbnail' : {},
|
||||
'fileattributematcher' : {},
|
||||
'filter-streams' : {},
|
||||
'giomodule' : {},
|
||||
'giomodule' : {
|
||||
'depends' : glib_build_shared ? [libtestmodulea, libtestmoduleb] : [],
|
||||
},
|
||||
'gsubprocess' : {
|
||||
'suite': host_system == 'windows' ? ['flaky'] : [],
|
||||
'extra_programs': ['gsubprocess-testprog'],
|
||||
},
|
||||
'g-file' : {},
|
||||
'g-file-info' : {
|
||||
@ -125,6 +132,7 @@ gio_tests = {
|
||||
'tls-bindings' : {'extra_sources' : ['gtesttlsbackend.c']},
|
||||
'unix-fd' : {},
|
||||
'gdbus-address-get-session' : {
|
||||
'extra_programs': host_system != 'windows' ? ['dbus-launch'] : [],
|
||||
# FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
|
||||
'can_fail' : host_system == 'darwin',
|
||||
},
|
||||
@ -259,9 +267,12 @@ if host_machine.system() != 'windows'
|
||||
gio_tests += {
|
||||
'appinfo' : {
|
||||
'install' : false,
|
||||
'extra_programs' : ['appinfo-test'],
|
||||
},
|
||||
'desktop-app-info' : {
|
||||
'install' : false,
|
||||
'depends' : gio_launch_desktop,
|
||||
'extra_programs' : ['apps', 'appinfo-test'],
|
||||
},
|
||||
}
|
||||
endif
|
||||
@ -347,6 +358,7 @@ if host_machine.system() != 'windows'
|
||||
]
|
||||
|
||||
extra_sources = ['gdbus-sessionbus.c', 'gdbus-tests.c']
|
||||
extra_programs = ['gdbus-testserver']
|
||||
|
||||
gio_tests += {
|
||||
'actions' : {
|
||||
@ -356,31 +368,56 @@ if host_machine.system() != 'windows'
|
||||
'gdbus-auth' : {'extra_sources' : extra_sources},
|
||||
'gdbus-bz627724' : {'extra_sources' : extra_sources},
|
||||
'gdbus-close-pending' : {'extra_sources' : extra_sources},
|
||||
'gdbus-connection' : {'extra_sources' : extra_sources},
|
||||
'gdbus-connection-loss' : {'extra_sources' : extra_sources},
|
||||
'gdbus-connection-slow' : {'extra_sources' : extra_sources},
|
||||
'gdbus-connection' : {
|
||||
'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-exit-on-close' : {'extra_sources' : extra_sources},
|
||||
'gdbus-export' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'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-names' : {'extra_sources' : extra_sources},
|
||||
'gdbus-proxy' : {'extra_sources' : extra_sources},
|
||||
'gdbus-names' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'extra_programs' : ['fake-service-name'],
|
||||
},
|
||||
'gdbus-proxy' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'extra_programs': extra_programs,
|
||||
},
|
||||
'gdbus-proxy-threads' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'dependencies' : [dbus1_dep],
|
||||
},
|
||||
'gdbus-proxy-unique-name' : {'extra_sources' : extra_sources},
|
||||
'gdbus-proxy-well-known-name' : {'extra_sources' : extra_sources},
|
||||
'gdbus-proxy-unique-name' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'extra_programs': extra_programs,
|
||||
},
|
||||
'gdbus-proxy-well-known-name' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'extra_programs': extra_programs,
|
||||
},
|
||||
'gdbus-test-codegen' : {
|
||||
'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
|
||||
'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
|
||||
},
|
||||
'gdbus-threading' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'extra_programs': extra_programs,
|
||||
'suite' : ['slow'],
|
||||
},
|
||||
'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],
|
||||
'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
|
||||
gio_tests += {
|
||||
'dbus-appinfo' : {
|
||||
'extra_sources' : extra_sources,
|
||||
'extra_programs' : ['fake-document-portal'],
|
||||
},
|
||||
}
|
||||
endif
|
||||
@ -459,6 +500,7 @@ if host_machine.system() != 'windows'
|
||||
'c_args' : ['-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
||||
'-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir)],
|
||||
'install' : false,
|
||||
'depends' : glib_compile_schemas,
|
||||
},
|
||||
}
|
||||
endif
|
||||
@ -544,33 +586,36 @@ if host_machine.system() != 'windows'
|
||||
endif
|
||||
|
||||
appinfo_test_desktop_files = [
|
||||
'appinfo-test-gnome.desktop',
|
||||
'appinfo-test-notgnome.desktop',
|
||||
'appinfo-test.desktop',
|
||||
'appinfo-test2.desktop',
|
||||
'appinfo-test-gnome',
|
||||
'appinfo-test-notgnome',
|
||||
'appinfo-test',
|
||||
'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
|
||||
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
|
||||
configure_file(
|
||||
input: appinfo_test_desktop_file + '.in',
|
||||
output: appinfo_test_desktop_file,
|
||||
installed_desktop = configure_file(
|
||||
input: input_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_tag: 'tests',
|
||||
configuration: cdata,
|
||||
)
|
||||
else
|
||||
configure_file(
|
||||
input: appinfo_test_desktop_file + '.in',
|
||||
output: appinfo_test_desktop_file,
|
||||
configuration: cdata,
|
||||
rename: output_desktop_file,
|
||||
)
|
||||
endif
|
||||
endforeach
|
||||
@ -657,6 +702,7 @@ endif
|
||||
|
||||
if meson.can_run_host_binaries()
|
||||
|
||||
resource_plugin = []
|
||||
compiler_type = '--compiler=@0@'.format(cc.get_id())
|
||||
|
||||
if glib_build_shared
|
||||
@ -672,7 +718,8 @@ if meson.can_run_host_binaries()
|
||||
'--c-name', '_g_plugin',
|
||||
'@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,
|
||||
dependencies : common_gio_tests_deps,
|
||||
install_dir : installed_tests_execdir,
|
||||
@ -865,10 +912,28 @@ if meson.can_run_host_binaries()
|
||||
gio_tests += {
|
||||
'resources' : {
|
||||
'extra_sources' : resources_extra_sources,
|
||||
'depends' : resource_plugin,
|
||||
},
|
||||
}
|
||||
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
|
||||
source = extra_args.get('source', test_name + '.c')
|
||||
extra_sources = extra_args.get('extra_sources', [])
|
||||
@ -910,6 +975,11 @@ foreach test_name, extra_args : gio_tests
|
||||
suite = ['gio'] + extra_args.get('suite', [])
|
||||
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
||||
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', {})
|
||||
local_test_env.append(var, value)
|
||||
@ -924,34 +994,27 @@ foreach test_name, extra_args : gio_tests
|
||||
timeout : timeout,
|
||||
suite : suite,
|
||||
is_parallel : extra_args.get('is_parallel', true),
|
||||
depends : extra_args.get('depends', []),
|
||||
depends : depends,
|
||||
should_fail : extra_args.get('should_fail', false),
|
||||
)
|
||||
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
|
||||
depends = [extra_args.get('depends', [])]
|
||||
suite = ['gio', 'no-valgrind']
|
||||
|
||||
if extra_args.get('can_fail', false)
|
||||
suite += 'failing'
|
||||
endif
|
||||
|
||||
foreach program : extra_args.get('extra_programs', [])
|
||||
depends += test_extra_programs_targets[program]
|
||||
endforeach
|
||||
|
||||
test(
|
||||
test_name,
|
||||
python,
|
||||
depends: depends,
|
||||
args: ['-B', files(test_name)],
|
||||
env: test_env,
|
||||
suite: suite,
|
||||
@ -989,7 +1052,3 @@ if installed_tests_enabled
|
||||
endif
|
||||
|
||||
subdir('services')
|
||||
|
||||
if glib_build_shared
|
||||
subdir('modules')
|
||||
endif
|
||||
|
@ -115,18 +115,30 @@ glib_tests = {
|
||||
'spawn-multithreaded' : {
|
||||
'can_fail': glib_build_static and host_system == 'windows',
|
||||
'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' : {
|
||||
'dependencies' : [winsock2],
|
||||
'extra_programs' : ['test-spawn-echo'],
|
||||
},
|
||||
'spawn-test' : {
|
||||
'can_fail': host_system == 'windows' and cc.get_id() == 'gcc',
|
||||
'extra_programs' : host_machine.system() == 'windows' ? ['spawn-test-win32-gui'] : [],
|
||||
},
|
||||
'strfuncs' : {},
|
||||
'string' : {},
|
||||
'strvbuilder' : {},
|
||||
'testing' : {},
|
||||
'testing' : {
|
||||
'extra_programs' : ['testing-helper'],
|
||||
},
|
||||
'test-printf' : {},
|
||||
'thread' : {},
|
||||
'thread-deprecated' : {},
|
||||
@ -265,6 +277,23 @@ if installed_tests_enabled
|
||||
)
|
||||
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.set('G_TEST_SRCDIR', meson.current_source_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_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
|
||||
source = extra_args.get('source', test_name + '.c')
|
||||
install = installed_tests_enabled and extra_args.get('install', true)
|
||||
@ -301,6 +351,7 @@ foreach test_name, extra_args : glib_tests
|
||||
install: install,
|
||||
)
|
||||
|
||||
depends = [extra_args.get('depends', [])]
|
||||
suite = ['glib'] + extra_args.get('suite', [])
|
||||
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
||||
|
||||
@ -308,7 +359,12 @@ foreach test_name, extra_args : glib_tests
|
||||
suite += 'failing'
|
||||
endif
|
||||
|
||||
foreach program : extra_args.get('extra_programs', [])
|
||||
depends += test_extra_programs_targets[program]
|
||||
endforeach
|
||||
|
||||
test(test_name, exe,
|
||||
depends : depends,
|
||||
env : test_env,
|
||||
timeout : timeout,
|
||||
suite : suite,
|
||||
@ -327,28 +383,26 @@ endif
|
||||
python_tests = {
|
||||
'assert-msg-test.py' : {
|
||||
'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
|
||||
depends = [extra_args.get('depends', [])]
|
||||
suite = ['glib', 'no-valgrind']
|
||||
|
||||
if extra_args.get('can_fail', false)
|
||||
suite += 'failing'
|
||||
endif
|
||||
|
||||
foreach program : extra_args.get('extra_programs', [])
|
||||
depends += test_extra_programs_targets[program]
|
||||
endforeach
|
||||
|
||||
test(
|
||||
test_name,
|
||||
python,
|
||||
depends: depends,
|
||||
args: ['-B', files(test_name)],
|
||||
env: test_env,
|
||||
suite: suite,
|
||||
@ -376,58 +430,6 @@ foreach test_name, extra_args : python_tests
|
||||
endif
|
||||
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
|
||||
if meson.can_run_host_binaries() and host_system != 'windows'
|
||||
xmllint = find_program('xmllint', required: false)
|
||||
@ -445,4 +447,3 @@ if meson.can_run_host_binaries() and host_system != 'windows'
|
||||
endif
|
||||
endif
|
||||
|
||||
subdir('path-test-subdir')
|
||||
|
@ -1,7 +1,10 @@
|
||||
executable('spawn-test-helper', 'spawn-test-helper.c',
|
||||
c_args : test_cargs,
|
||||
dependencies : test_deps,
|
||||
install_dir: join_paths(installed_tests_execdir, 'path-test-subdir'),
|
||||
install_tag: 'tests',
|
||||
install: installed_tests_enabled,
|
||||
)
|
||||
test_extra_programs_targets += {
|
||||
'spawn-test-helper-subdir' : executable('spawn-test-helper',
|
||||
sources: 'spawn-test-helper.c',
|
||||
c_args : test_cargs,
|
||||
dependencies : test_deps,
|
||||
install_dir: installed_tests_execdir / 'path-test-subdir',
|
||||
install_tag: 'tests',
|
||||
install: installed_tests_enabled,
|
||||
),
|
||||
}
|
||||
|
@ -33,7 +33,10 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
static char *echo_prog_path;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static char *sleep_prog_path;
|
||||
#endif
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
#include <unistd.h>
|
||||
@ -425,14 +428,15 @@ main (int argc,
|
||||
|
||||
dirname = g_path_get_dirname (argv[0]);
|
||||
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));
|
||||
#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));
|
||||
#endif
|
||||
|
||||
g_clear_pointer (&dirname, g_free);
|
||||
|
||||
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-sync", test_spawn_sync_multithreaded);
|
||||
@ -441,7 +445,10 @@ main (int argc,
|
||||
ret = g_test_run();
|
||||
|
||||
g_free (echo_prog_path);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
g_free (sleep_prog_path);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,17 +1,5 @@
|
||||
gmodule_tests = {
|
||||
'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
|
||||
@ -40,16 +28,20 @@ if ['darwin', 'ios'].contains(host_machine.system())
|
||||
module_suffix = 'so'
|
||||
endif
|
||||
|
||||
gmodule_test_modules = []
|
||||
gmodule_test_libraries = []
|
||||
if glib_build_shared
|
||||
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],
|
||||
install_dir : installed_tests_execdir,
|
||||
install_tag : 'tests',
|
||||
install : installed_tests_enabled,
|
||||
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],
|
||||
install_dir : installed_tests_execdir,
|
||||
install_tag : 'tests',
|
||||
@ -59,6 +51,23 @@ if glib_build_shared
|
||||
endforeach
|
||||
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.set('G_TEST_SRCDIR', meson.current_source_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', [])
|
||||
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
||||
depends = [extra_args.get('depends', [])]
|
||||
|
||||
if extra_args.get('can_fail', false)
|
||||
suite += 'failing'
|
||||
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
|
||||
|
@ -170,7 +170,7 @@ libgobject_dep = declare_dependency(link_with : libgobject,
|
||||
)
|
||||
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_tag : 'bin-devel',
|
||||
dependencies : [libglib_dep, libgobject_dep])
|
||||
|
@ -126,6 +126,7 @@ endif
|
||||
python_tests = {
|
||||
'genmarshal.py' : {},
|
||||
'gobject-query.py' : {
|
||||
'depends' : gobject_query,
|
||||
'can_fail' : host_system == 'windows',
|
||||
},
|
||||
'mkenums.py' : {},
|
||||
@ -183,6 +184,7 @@ foreach test_name, extra_args : gobject_tests
|
||||
endforeach
|
||||
|
||||
foreach test_name, extra_args : python_tests
|
||||
depends = [extra_args.get('depends', [])]
|
||||
suite = ['gobject', 'no-valgrind']
|
||||
|
||||
if extra_args.get('can_fail', false)
|
||||
@ -192,6 +194,7 @@ foreach test_name, extra_args : python_tests
|
||||
test(
|
||||
test_name,
|
||||
python,
|
||||
depends: depends,
|
||||
args: ['-B', files(test_name)],
|
||||
env: test_env,
|
||||
suite: suite,
|
||||
|
Loading…
Reference in New Issue
Block a user