Merge branch '436-test-coredumps' into 'master'

Fix tests creating coredumps

Closes #436

See merge request GNOME/glib!959
This commit is contained in:
Emmanuele Bassi 2019-07-25 13:49:09 +00:00
commit 17be9e5c4c
4 changed files with 41 additions and 20 deletions

View File

@ -2518,6 +2518,14 @@ prepend_terminal_to_vector (int *argc,
term_argv = g_new0 (char *, 3); term_argv = g_new0 (char *, 3);
check = g_find_program_in_path ("gnome-terminal"); check = g_find_program_in_path ("gnome-terminal");
if (check != NULL)
{
term_argv[0] = check;
/* Since 2017, gnome-terminal has preferred `--` over `-x` or `-e`. */
term_argv[1] = g_strdup ("--");
}
else
{
if (check == NULL) if (check == NULL)
check = g_find_program_in_path ("mate-terminal"); check = g_find_program_in_path ("mate-terminal");
if (check == NULL) if (check == NULL)
@ -2547,6 +2555,7 @@ prepend_terminal_to_vector (int *argc,
term_argv[0] = check; term_argv[0] = check;
term_argv[1] = g_strdup ("-e"); term_argv[1] = g_strdup ("-e");
} }
}
real_argc = term_argc + *argc; real_argc = term_argc + *argc;
real_argv = g_new (char *, real_argc + 1); real_argv = g_new (char *, real_argc + 1);

View File

@ -9,7 +9,7 @@ Comment=GAppInfo example
Comment[de]=GAppInfo Beispiel Comment[de]=GAppInfo Beispiel
Exec=@installed_tests_dir@/appinfo-test --option %U %i --name %c --filename %k %m %% Exec=@installed_tests_dir@/appinfo-test --option %U %i --name %c --filename %k %m %%
Icon=testicon.svg Icon=testicon.svg
Terminal=true Terminal=false
StartupNotify=true StartupNotify=true
StartupWMClass=appinfo-class StartupWMClass=appinfo-class
MimeType=image/png;image/jpeg; MimeType=image/png;image/jpeg;

View File

@ -87,7 +87,7 @@ test_launch_no_app_id (void)
"Comment=GAppInfo example\n" "Comment=GAppInfo example\n"
"Comment[de]=GAppInfo Beispiel\n" "Comment[de]=GAppInfo Beispiel\n"
"Icon=testicon.svg\n" "Icon=testicon.svg\n"
"Terminal=true\n" "Terminal=false\n"
"StartupNotify=true\n" "StartupNotify=true\n"
"StartupWMClass=appinfo-class\n" "StartupWMClass=appinfo-class\n"
"MimeType=image/png;image/jpeg;\n" "MimeType=image/png;image/jpeg;\n"

View File

@ -3323,6 +3323,18 @@ g_test_trap_fork (guint64 usec_timeout,
close (stdout_pipe[1]); close (stdout_pipe[1]);
if (stderr_pipe[1] >= 3) if (stderr_pipe[1] >= 3)
close (stderr_pipe[1]); close (stderr_pipe[1]);
/* We typically expect these child processes to crash, and some
* tests spawn a *lot* of them. Avoid spamming system crash
* collection programs such as systemd-coredump and abrt.
*/
#ifdef HAVE_SYS_RESOURCE_H
{
struct rlimit limit = { 0, 0 };
(void) setrlimit (RLIMIT_CORE, &limit);
}
#endif
return TRUE; return TRUE;
} }
else /* parent */ else /* parent */