diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-05-09 08:12:43 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-05-09 08:12:43 +1000 |
commit | a9b3deb60f2c86e6538ea0fc659d93c29f177c2c (patch) | |
tree | f99b75f3ccdbc933c6054f5984e206ec01d3ffa1 /test | |
parent | 78322a9b45dbddcbe783d209984f3ab724296255 (diff) | |
download | libevdev-a9b3deb60f2c86e6538ea0fc659d93c29f177c2c.tar.gz |
test: disable coredumps during test suite runs
It's a test suite, it shouldn't fill up the file system or the journal with
coredumps.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/test-main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test-main.c b/test/test-main.c index 83fce14..1f7f6f4 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -22,9 +22,11 @@ #include <config.h> #include <check.h> +#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/ptrace.h> +#include <sys/resource.h> #include <sys/wait.h> #include <libevdev/libevdev.h> @@ -68,11 +70,15 @@ is_debugger_attached(void) int main(int argc, char **argv) { + const struct rlimit corelimit = {0, 0}; int failed; if (is_debugger_attached()) setenv("CK_FORK", "no", 0); + if (setrlimit(RLIMIT_CORE, &corelimit) != 0) + perror("WARNING: Core dumps not disabled. Reason"); + libevdev_set_log_function(test_logfunc_abort_on_error, NULL); Suite *s = libevdev_has_event_test(); |