test: separate quick, live, and stress checks
This commit is contained in:
@@ -19,9 +19,12 @@ XIM_LIBS = $(shell pkg-config --libs xcb-imdkit xkbcommon-x11)
|
||||
LIBS = -lthread -lbio $(TEXT_LIBS) $(IBUS_LIBS) $(XIM_LIBS)
|
||||
|
||||
PROG = unit_test
|
||||
LIVE = ibus_live_test ibus_client_smoke gtk_live_test xim_live_test \
|
||||
ipc_live_test daemon_collision_test daemon_failure_test daemon_restart_test
|
||||
TESTSRC = unit_test.c test_util.c str_test.c hash_test.c trie_test.c \
|
||||
STRESS = stress_test
|
||||
SMOKE = ibus_live_test ibus_client_smoke gtk_live_test xim_live_test \
|
||||
ipc_live_test
|
||||
FAULT = daemon_collision_test daemon_failure_test daemon_restart_test
|
||||
LIVE = $(SMOKE) $(FAULT)
|
||||
TESTSRC = test_util.c str_test.c hash_test.c trie_test.c \
|
||||
ko_test.c vi_test.c engine_test.c dict_test.c ipc_test.c \
|
||||
popup_test.c font_test.c ibus_test.c server_test.c xim_adapter_test.c
|
||||
TESTOBJ = $(TESTSRC:.c=.o)
|
||||
@@ -29,22 +32,36 @@ PARENTSRC = str.c hash.c trie.c dict.c ko.c vi.c ipc.c popup_layout.c \
|
||||
font.c
|
||||
PARENTOBJ = $(PARENTSRC:%.c=unit_%.o)
|
||||
XIMOBJ = unit_xim_keymap.o unit_ximtext.o
|
||||
OBJS = $(TESTOBJ) $(PARENTOBJ) $(XIMOBJ)
|
||||
COMMONOBJ = $(TESTOBJ) $(PARENTOBJ) $(XIMOBJ)
|
||||
OBJS = unit_test.o stress_test.o $(COMMONOBJ)
|
||||
|
||||
all: $(PROG) $(LIVE)
|
||||
all: $(PROG) $(STRESS) $(LIVE)
|
||||
|
||||
check test: $(PROG) $(LIVE) ../gtk/im-strans.so
|
||||
./$(PROG) $(TESTARGS)
|
||||
check test: $(PROG)
|
||||
./$(PROG) $(UNITARGS)
|
||||
|
||||
check-live: $(SMOKE) ../strans ../gtk/im-strans.so
|
||||
./ibus_live_test ../strans ../map ./ibus_client_smoke
|
||||
./gtk_live_test ../gtk/im-strans.so
|
||||
./xim_live_test ../strans ../map
|
||||
./ipc_live_test ../strans ../map
|
||||
|
||||
check-stress: $(STRESS) ibus_live_test ipc_live_test $(FAULT) ../strans
|
||||
./$(STRESS)
|
||||
./ibus_live_test --capacity ../strans ../map
|
||||
./ipc_live_test --capacity ../strans ../map
|
||||
./daemon_collision_test ../strans ../map
|
||||
./daemon_failure_test ../strans
|
||||
./daemon_restart_test ../strans ../map
|
||||
|
||||
$(PROG): $(OBJS)
|
||||
$(LD) -o $@ $(OBJS) $(LIBS)
|
||||
$(PROG): unit_test.o $(COMMONOBJ)
|
||||
$(LD) -o $@ unit_test.o $(COMMONOBJ) $(LIBS)
|
||||
|
||||
$(STRESS): stress_test.o $(COMMONOBJ)
|
||||
$(LD) -o $@ stress_test.o $(COMMONOBJ) $(LIBS)
|
||||
|
||||
stress_test.o: unit_test.c
|
||||
$(CC) $(CFLAGS) -DSTRESS -c -o $@ $<
|
||||
|
||||
ibus_live_test: ibus_live_test.c
|
||||
$(HOSTCC) -std=c99 -Wall -Wextra -O2 -g $(DBUS_CFLAGS) -o $@ $< $(DBUS_LIBS)
|
||||
@@ -60,6 +77,9 @@ gtk_live_test: gtk_live_test.c ../ipc.c ../ipc.h
|
||||
../gtk/im-strans.so: ../gtk/main.c ../ipc.c ../ipc.h
|
||||
$(MAKE) -C ../gtk
|
||||
|
||||
../strans:
|
||||
$(MAKE) -C .. strans
|
||||
|
||||
xim_live_test: xim_live_test.c ../ipc.c ../ipc.h
|
||||
$(HOSTCC) -std=c99 -Wall -Wextra -O2 -g -I.. $(X11_CFLAGS) -o $@ \
|
||||
xim_live_test.c ../ipc.c $(X11_LIBS)
|
||||
@@ -78,7 +98,8 @@ daemon_restart_test: daemon_restart_test.c ../ipc.c ../ipc.h
|
||||
$(HOSTCC) -std=c99 -Wall -Wextra -O2 -g -I.. $(DBUS_CFLAGS) -o $@ \
|
||||
daemon_restart_test.c ../ipc.c $(DBUS_LIBS)
|
||||
|
||||
$(TESTOBJ): test.h ../dat.h ../fn.h ../ipc.h ../cutest/cutest.h
|
||||
unit_test.o stress_test.o $(TESTOBJ): test.h ../dat.h ../fn.h ../ipc.h \
|
||||
../cutest/cutest.h
|
||||
engine_test.o: ../strans.c
|
||||
ibus_test.o: CFLAGS += $(IBUS_CFLAGS)
|
||||
ibus_test.o: ../ibus.c
|
||||
@@ -100,6 +121,6 @@ unit_%.o: ../%.c ../dat.h ../fn.h ../ipc.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(PROG) $(LIVE)
|
||||
rm -f $(OBJS) $(PROG) $(STRESS) $(LIVE)
|
||||
|
||||
.PHONY: all check test clean
|
||||
.PHONY: all check check-live check-stress test clean
|
||||
|
||||
Reference in New Issue
Block a user