summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-06-29 11:13:44 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-06-29 11:15:41 +1000
commite4c3a8ee7a7f2ec25ce89ab11b04675e285b1411 (patch)
treed0bb11adc6b4551ee6d4fdde2b3dcab0b4609e76 /test
parentc4cfd7668a279f80877707b97417850e4670a587 (diff)
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 <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r--test/test-main.c2
1 files changed, 2 insertions, 0 deletions
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");