Commit 02b22eba authored by Pavel Emelyanov's avatar Pavel Emelyanov

test: Merge zdtm/live streaming and transition tests

These two sets are the same -- they test something and ask to be
C/R-ed at the time they do it. No other differences.
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent d545a2d8
SUBDIRS = streaming transition static
SUBDIRS = transition static
default: all
.PHONY: default
......
include ../../Makefile.inc
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall -Werror -fno-strict-aliasing
CFLAGS += $(USERCFLAGS)
TST_NOFILE = \
pipe_loop00 \
pipe_shared00 \
socket_loop00 \
netlink00 \
file_aio \
socket-tcp \
socket-tcp6 \
TST_FILE = \
unix_sock \
fifo_dyn \
fifo_loop \
TST = $(TST_NOFILE) $(TST_FILE)
SRC = $(TST:%=%.c)
OBJ = $(SRC:%.c=%.o)
DEP = $(SRC:%.c=%.d)
PID = $(TST:%=%.pid)
OUT = $(TST:%=%.out)
DEPEND.c = $(COMPILE.c) -MM -MP
%.d: %.c
$(DEPEND.c) $(OUTPUT_OPTION) $<
all: $(TST)
install: all
.PHONY: all install
$(TST_NOFILE:%=%.pid): %.pid: %
$(<D)/$(<F) --pidfile=$@ --outfile=$<.out
$(TST_FILE:%=%.pid): %.pid: %
$(<D)/$(<F) --pidfile=$@ --outfile=$<.out --filename=$<.test
%.out: %.pid %
-kill -TERM `cat $<`
start: $(PID)
%.is_running: %.pid
kill -0 `cat $<`
check_start: $(PID:%.pid=%.is_running)
stop:
-kill -TERM `cat *.pid`
WAIT_TIME=10
wait_stop:
-for i in `seq 1 $(WAIT_TIME)`; do \
kill -0 `cat *.pid 2>/dev/null` 2>/dev/null || break; \
sleep 1; \
done
$(TST): $(LIB)
file_aio: override LDLIBS += -lrt -pthread
socket-tcp: override CFLAGS += -D STREAM
socket-tcp6: override CFLAGS += -D ZDTM_IPV6 -D STREAM
$(LIB): force
$(Q) $(MAKE) -C $(LIBDIR)
clean:
$(RM) -f $(OBJ) $(TST) *~
cleandep: clean
$(RM) -f $(DEP)
%.cleanout: %
$(Q) $(RM) -f -r $<.pid $<.init.pid $<.out* $<.test
cleanout:
$(RM) -f *.pid *.out* *.test*
realclean: cleandep cleanout
.PHONY: force clean cleandep cleanout realclean start check_start stop wait_stop
ifeq ($(filter-out no-deps-targets, $(MAKECMDGOALS)),)
-include $(DEP)
endif
......@@ -3,7 +3,7 @@ include ../../Makefile.inc
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall -Werror
CFLAGS = -g -O2 -Wall -Werror -fno-strict-aliasing
CFLAGS += $(USERCFLAGS)
TST_NOFILE = \
......@@ -14,9 +14,21 @@ TST_NOFILE = \
fork2 \
thread-bomb \
maps007 \
pipe_loop00 \
pipe_shared00 \
socket_loop00 \
netlink00 \
file_aio \
socket-tcp \
socket-tcp6 \
TST_FILE = \
file_read \
unix_sock \
fifo_dyn \
fifo_loop \
TST = $(TST_NOFILE) $(TST_FILE)
SRC = $(TST:%=%.c)
......@@ -61,11 +73,14 @@ wait_stop:
$(TST): $(LIB)
file_aio: override LDLIBS += -lrt -pthread
socket-tcp: override CFLAGS += -D STREAM
socket-tcp6: override CFLAGS += -D ZDTM_IPV6 -D STREAM
ptrace.o: override CFLAGS += -pthread
ptrace: override LDFLAGS += -pthread
fork2: override CFLAGS += -D FORK2
thread-bomb.o: override CFLAGS += -pthread
thread-bomb: override LDFLAGS += -pthread
thread-bomb.o: override CFLAGS += -pthread
thread-bomb: override LDFLAGS += -pthread
%: %.sh
cp $< $@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment