test: make clean checks trustworthy
This commit is contained in:
2
Makefile
2
Makefile
@@ -59,7 +59,7 @@ docker: docker-image
|
|||||||
check: verify-map test
|
check: verify-map test
|
||||||
$(MAKE) -C xim check
|
$(MAKE) -C xim check
|
||||||
|
|
||||||
test: $(PROG)
|
test: $(PROG) gtk
|
||||||
$(MAKE) -C tests check TESTARGS="$(TESTARGS)"
|
$(MAKE) -C tests check TESTARGS="$(TESTARGS)"
|
||||||
|
|
||||||
verify-map:
|
verify-map:
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ OBJS = $(TESTOBJ) $(PARENTOBJ) $(XIMOBJ)
|
|||||||
|
|
||||||
all: $(PROG) $(LIVE)
|
all: $(PROG) $(LIVE)
|
||||||
|
|
||||||
check test: $(PROG) $(LIVE)
|
check test: $(PROG) $(LIVE) ../gtk/im-strans.so
|
||||||
./$(PROG) $(TESTARGS)
|
./$(PROG) $(TESTARGS)
|
||||||
./ibus_live_test ../strans ../map ./ibus_client_smoke
|
./ibus_live_test ../strans ../map ./ibus_client_smoke
|
||||||
./gtk_live_test ../gtk/im-strans.so
|
./gtk_live_test ../gtk/im-strans.so
|
||||||
@@ -57,6 +57,9 @@ gtk_live_test: gtk_live_test.c ../ipc.c ../ipc.h
|
|||||||
$(HOSTCC) -std=c99 -Wall -Wextra -O2 -g -I.. $(GTK_CFLAGS) -o $@ \
|
$(HOSTCC) -std=c99 -Wall -Wextra -O2 -g -I.. $(GTK_CFLAGS) -o $@ \
|
||||||
gtk_live_test.c ../ipc.c $(GTK_LIBS) -pthread
|
gtk_live_test.c ../ipc.c $(GTK_LIBS) -pthread
|
||||||
|
|
||||||
|
../gtk/im-strans.so: ../gtk/main.c ../ipc.c ../ipc.h
|
||||||
|
$(MAKE) -C ../gtk
|
||||||
|
|
||||||
xim_live_test: xim_live_test.c ../ipc.c ../ipc.h
|
xim_live_test: xim_live_test.c ../ipc.c ../ipc.h
|
||||||
$(HOSTCC) -std=c99 -Wall -Wextra -O2 -g -I.. $(X11_CFLAGS) -o $@ \
|
$(HOSTCC) -std=c99 -Wall -Wextra -O2 -g -I.. $(X11_CFLAGS) -o $@ \
|
||||||
xim_live_test.c ../ipc.c $(X11_LIBS)
|
xim_live_test.c ../ipc.c $(X11_LIBS)
|
||||||
|
|||||||
@@ -624,11 +624,15 @@ main(int argc, char **argv)
|
|||||||
rootmade = 0;
|
rootmade = 0;
|
||||||
serverup = 0;
|
serverup = 0;
|
||||||
ok = 0;
|
ok = 0;
|
||||||
if(argc != 2)
|
if(argc != 2){
|
||||||
return fail("usage: gtk_live_test /path/to/im-strans.so");
|
fail("usage: gtk_live_test /path/to/im-strans.so");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
module = realpath(argv[1], NULL);
|
module = realpath(argv[1], NULL);
|
||||||
if(module == NULL)
|
if(module == NULL){
|
||||||
return fail("realpath %s: %s", argv[1], strerror(errno));
|
fail("realpath %s: %s", argv[1], strerror(errno));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
Check(mkdtemp(root) != NULL, "mkdtemp: %s", strerror(errno));
|
Check(mkdtemp(root) != NULL, "mkdtemp: %s", strerror(errno));
|
||||||
rootmade = 1;
|
rootmade = 1;
|
||||||
Check(snprintf(runtime, sizeof runtime, "%s/runtime", root) <
|
Check(snprintf(runtime, sizeof runtime, "%s/runtime", root) <
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ ximend(Ximfix *f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Keyreq
|
static Keyreq
|
||||||
nexttrace(struct ct *t, Ximfix *f, int op, Ic *state)
|
nexttracecap(struct ct *t, Ximfix *f, int op, Ic *owner, int cap)
|
||||||
{
|
{
|
||||||
Keyreq req;
|
Keyreq req;
|
||||||
|
|
||||||
@@ -416,12 +416,18 @@ nexttrace(struct ct *t, Ximfix *f, int op, Ic *state)
|
|||||||
if(!CT_CHECK(t, channbrecv(f->trace, &req) > 0))
|
if(!CT_CHECK(t, channbrecv(f->trace, &req) > 0))
|
||||||
return req;
|
return req;
|
||||||
CT_EQ_INT(t, op, req.op);
|
CT_EQ_INT(t, op, req.op);
|
||||||
CT_EQ_PTR(t, state, req.owner);
|
CT_EQ_PTR(t, owner, req.owner);
|
||||||
CT_EQ_INT(t, state->cap, req.cap);
|
CT_EQ_INT(t, cap, req.cap);
|
||||||
CT_EQ_PTR(t, replyc, req.reply);
|
CT_EQ_PTR(t, replyc, req.reply);
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Keyreq
|
||||||
|
nexttrace(struct ct *t, Ximfix *f, int op, Ic *state)
|
||||||
|
{
|
||||||
|
return nexttracecap(t, f, op, state, state->cap);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
notrace(struct ct *t, Ximfix *f)
|
notrace(struct ct *t, Ximfix *f)
|
||||||
{
|
{
|
||||||
@@ -489,6 +495,7 @@ xim_adapter_release_lifecycle(struct ct *t)
|
|||||||
Ximfix f;
|
Ximfix f;
|
||||||
Ic a, b, *dead;
|
Ic a, b, *dead;
|
||||||
Keyres res;
|
Keyres res;
|
||||||
|
int deadcap;
|
||||||
|
|
||||||
memset(&a, 0, sizeof a);
|
memset(&a, 0, sizeof a);
|
||||||
memset(&b, 0, sizeof b);
|
memset(&b, 0, sizeof b);
|
||||||
@@ -530,8 +537,9 @@ xim_adapter_release_lifecycle(struct ct *t)
|
|||||||
keypress(dead, 'n', 0, &res);
|
keypress(dead, 'n', 0, &res);
|
||||||
nexttrace(t, &f, Keypress, dead);
|
nexttrace(t, &f, Keypress, dead);
|
||||||
CT_EQ_PTR(t, dead, testengineowner());
|
CT_EQ_PTR(t, dead, testengineowner());
|
||||||
|
deadcap = dead->cap;
|
||||||
icfree(dead);
|
icfree(dead);
|
||||||
nexttrace(t, &f, Keyrelease, dead);
|
nexttracecap(t, &f, Keyrelease, dead, deadcap);
|
||||||
dead = nil;
|
dead = nil;
|
||||||
CT_EQ_PTR(t, nil, ics);
|
CT_EQ_PTR(t, nil, ics);
|
||||||
CT_EQ_PTR(t, nil, testengineowner());
|
CT_EQ_PTR(t, nil, testengineowner());
|
||||||
|
|||||||
Reference in New Issue
Block a user