mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-28 18:40:03 +01:00
tests: Zero the rlimit in standalone tests which are expected to abort
This should hopefully stop the kernel spending a lot of memory and disk bandwidth creating coredumps for them unnecessarily, which slows down the rest of the tests and generally wastes resources. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2939
This commit is contained in:
parent
e8c1bdbf4f
commit
85af9b73c9
@ -18,12 +18,21 @@
|
||||
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#include <glib.h>
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
/* We expect this test to abort, so try to avoid that creating a coredump */
|
||||
struct rlimit limit = { 0, 0 };
|
||||
(void) setrlimit (RLIMIT_CORE, &limit);
|
||||
#endif
|
||||
|
||||
g_assert (42 < 0);
|
||||
return 0;
|
||||
|
@ -23,6 +23,9 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#include <glib.h>
|
||||
|
||||
static gboolean malloc_eom = FALSE;
|
||||
@ -56,6 +59,12 @@ int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
/* We expect this test to abort, so try to avoid that creating a coredump */
|
||||
struct rlimit limit = { 0, 0 };
|
||||
(void) setrlimit (RLIMIT_CORE, &limit);
|
||||
#endif
|
||||
|
||||
g_setenv ("LC_ALL", "C", TRUE);
|
||||
|
||||
#ifndef ENOMEM
|
||||
|
Loading…
x
Reference in New Issue
Block a user