criu/test/Makefile
Filipe Brandenburger 3a8cf03d94 test: replace use of pcre grep with awk
Unfortunately, grep -P is not ubiquitous, so use awk with two regexps to
simulate the negative forward lookup in the grep -P expression.

Using awk doesn't really make it too unreadable, as using boolean operators
such as && and || might actually make it more intuitive than the extended
regexp.

Tested:
- sudo make -C test zdtm_ns
- sudo make -C test zdtm_nons

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-26 13:08:49 +04:00

40 lines
803 B
Makefile

TST = $(shell ./zdtm.sh -l)
ZDTM_ARGS ?= -C
.FORCE:
all: .FORCE
$(MAKE) zdtm
.PHONY: all
TESTS = unix-callback mem-snap rpc libcriu mounts/ext security
other: .FORCE
for t in $(TESTS); do \
$(MAKE) -C $$t run || break; \
done \
zdtm: .FORCE
$(MAKE) zdtm_ns
$(MAKE) zdtm_nons
.PHONY: zdtm
fault-injection: .FORCE
$(MAKE) -C fault-injection
.PHONY: fault-injection
zdtm_ns: $(shell echo "$(TST)" | tr ' ' '\n' | awk '/^ns\// && !/tty|pty/ {print}')
zdtm_nons: $(shell echo "$(TST)" | tr ' ' '\n' | awk '!/^ns\// || /tty|pty/ {print}')
override CFLAGS += -D_GNU_SOURCE
zdtm_ct: zdtm_ct.c
clean:
rm -rf zdtm_ct
$(MAKE) -C zdtm $@
$(TST): zdtm_ct
./zdtm.sh --ct ${ZDTM_ARGS} $(@) &> $(subst /,_,$@).log || \
{ flock Makefile cat $(subst /,_,$@).log; exit 1; }
.PHONY: zdtm_ns