From e4c3a8ee7a7f2ec25ce89ab11b04675e285b1411 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 29 Jun 2018 11:13:44 +1000 Subject: [PATCH] test: add LIBEVDEV_SKIP_ROOT_TESTS environment variable check Depending on the container, or other checks don't always work. Add an extra environment variable instead. Signed-off-by: Peter Hutterer --- test/test-main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test-main.c b/test/test-main.c index fa4c48c..1898d0c 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -91,6 +91,8 @@ int main(void) for (t = &__start_test_section; t < &__stop_test_section; t++) { if (t->needs_root_privileges) { + if (getenv("LIBEVDEV_SKIP_ROOT_TESTS")) + return 77; if (getuid() != 0) { fprintf(stderr, "This test needs to run as root\n");