mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 15:48:54 +02:00
glib/tests/meson: Add test programs dependencies to single tests
Various glib tests (such as the spawn ones) depend on local binaries being built, this may not happen (especially when not using installed tests), thus ensure such dependencies via the newly added extra_programs key
This commit is contained in:
@@ -118,18 +118,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' : {},
|
||||||
@@ -374,6 +386,7 @@ 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'],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,7 +31,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>
|
||||||
@@ -423,14 +426,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);
|
||||||
@@ -439,7 +443,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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user