Add generic support for running tests as root.

By setting `ASROOT=1` in a unit test makefile a test will now run as
root, using `sudo -n`.

This patch allows us to simplify the pidfilefn() test.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-08-23 01:30:29 +02:00
1 parent e8ff38ad6a
commit 44e787c966
3 files changed
+22 -7

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
OBJS = pidfile.o chomp.o
TARGET = $(OBJS) pidfilefn.test clean
CPPFLAGS = -D_PATHS_H_ -D_PATH_VARRUN="\"/tmp/\""
OBJS = pidfile.o chomp.o fexist.o
ASROOT = 1
TARGET = clean $(OBJS) pidfilefn.test
include rules.mk