mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 15:50:08 +01:00
test: skip tests when we're not root
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
parent
6ff816163e
commit
fbeeef9cde
2 changed files with 10 additions and 0 deletions
|
|
@ -167,6 +167,11 @@ int main(int argc, char **argv)
|
|||
TCase *tc;
|
||||
int failed;
|
||||
|
||||
if (getuid() != 0) {
|
||||
fprintf(stderr, "This test needs to run as root\n");
|
||||
return 77;
|
||||
}
|
||||
|
||||
s = suite_create("kernel tests");
|
||||
|
||||
tc = tcase_create("EVIOCREVOKE");
|
||||
|
|
|
|||
|
|
@ -73,6 +73,11 @@ int main(void)
|
|||
const struct rlimit corelimit = {0, 0};
|
||||
int failed;
|
||||
|
||||
if (getuid() != 0) {
|
||||
fprintf(stderr, "This test needs to run as root\n");
|
||||
return 77;
|
||||
}
|
||||
|
||||
if (is_debugger_attached())
|
||||
setenv("CK_FORK", "no", 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue