mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-04-03 22:00:38 +02:00
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>
This commit is contained in:
parent
78322a9b45
commit
a9b3deb60f
1 changed files with 6 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue