forked from drath/libratbag
test: disable core dumps in the test suite
No need for this to end up in the journal Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
5637755345
commit
f6e5dd6c2c
@@ -31,6 +31,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include "libratbag.h"
|
||||
|
||||
@@ -162,6 +163,9 @@ int main(void)
|
||||
Suite *s;
|
||||
SRunner *sr;
|
||||
bool using_valgrind;
|
||||
const struct rlimit corelimit = { 0, 0 };
|
||||
|
||||
setrlimit(RLIMIT_CORE, &corelimit);
|
||||
|
||||
/* when running under valgrind we're using nofork mode, so a
|
||||
* signal raised by a test will fail in valgrind */
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include "libratbag.h"
|
||||
#include "libratbag-test.h"
|
||||
@@ -932,6 +933,9 @@ int main(void)
|
||||
int nfailed;
|
||||
Suite *s;
|
||||
SRunner *sr;
|
||||
const struct rlimit corelimit = { 0, 0 };
|
||||
|
||||
setrlimit(RLIMIT_CORE, &corelimit);
|
||||
|
||||
s = test_context_suite();
|
||||
sr = srunner_create(s);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <check.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include "libratbag-util.h"
|
||||
|
||||
@@ -166,6 +167,9 @@ int main(void)
|
||||
int nfailed;
|
||||
Suite *s;
|
||||
SRunner *sr;
|
||||
const struct rlimit corelimit = { 0, 0 };
|
||||
|
||||
setrlimit(RLIMIT_CORE, &corelimit);
|
||||
|
||||
s = test_context_suite();
|
||||
sr = srunner_create(s);
|
||||
|
||||
@@ -29,6 +29,7 @@ import argparse
|
||||
import imp
|
||||
import io
|
||||
import os
|
||||
import resource
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -529,6 +530,8 @@ def main(argv):
|
||||
if not os.geteuid() == 0:
|
||||
sys.exit('Script must be run as root')
|
||||
|
||||
resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
|
||||
|
||||
args = parse(argv)
|
||||
|
||||
unittest.main(argv=[sys.argv[0], *args])
|
||||
|
||||
Reference in New Issue
Block a user