12to11/tests/Imakefile
hujianwei 686f71c3b4 Add seat testing mechanism and tests for seats
* 12to11-test.xml (test_manager): <error>: Add `invalid_button',
`value_exists', `bad_seat_version' and `invalid_valuator'.
(test_manager): <get_test_seat>: New request.
(test_XIButtonState, test_XIModifierState, test_XIValuatorState)
(test_seat_controller): New interfaces.
* Imakefile: (seat.o): Depend on test_seat.c.
* compositor.h: Update prototypes.
* run.c (XLRunCompositor): Get rid of stdbool constant.
* seat.c (HandleBind1): Move binding logic to this new function.
(HandleBind): Call HandleBind1.
(InitSeatCommon): Add list initialization to this function.
(MakeSeatForDevicePair): Call InitSeatCommon instead.
(HandleRawKey, UpdateModifiersForSeats, DispatchFocusIn)
(DispatchMotion, DispatchBarrierHit, DispatchGesturePinch)
(DispatchGestureSwipe): Do not update user time from send_event
events.  Include test_seat.c.
* test.c (GetTestSeat): New function.
(test_manager_impl): Add new proc function.
(XLLookUpTestSurface): New function.
* tests/Imakefile (OBJS8, SRCS8): New program.
(PROGRAMS): Add seat_test.
(seat_test): New function.
* tests/run_tests.sh (standard_tests): Add seat_test.
* tests/svnignore.txt: Add seat_test.
* tests/test_harness.c (report_test_internal_error,
test_init_seat): New functions.
* tests/test_harness.h (struct test_seat): New struct.
(struct test_display): New field `seat'.
2022-11-07 06:21:07 +00:00

68 lines
3 KiB
Text

#include "../12to11.conf"
12TO11ROOT = ..
DEPLIBS = $(DEPXLIB)
SYS_LIBRARIES = MathLibrary
LOCAL_LIBRARIES = $(WAYLAND_CLIENT) $(XLIB) $(PNG)
COMMONOBJS = test_harness.o
COMMONSRCS = test_harness.c
HEADER = test_harness.h
GENFILES =
EXTRA_DEFINES := -D_GNU_SOURCE -U_BSD_SOURCE -U_SVID_SOURCE
#define ScannerTarget(name) @@\
name.h: $(12TO11ROOT)/name.xml @@\
$(WAYLAND_SCANNER) client-header $< $@ @@\
@@\
name.c: $(12TO11ROOT)/name.xml name.h @@\
$(WAYLAND_SCANNER) private-code $< $@ @@\
@@\
COMMONOBJS := $(COMMONOBJS) name.o @@\
COMMONSRCS := $(COMMONSRCS) name.c @@\
GENFILES := $(GENFILES) name.c name.h @@\
HEADER := $(HEADER) name.h @@\
ScannerTarget(12to11-test)
ScannerTarget(viewporter)
/* Not actually a test. */
SRCS1 = $(COMMONSRCS) imgview.c
OBJS1 = $(COMMONSRCS) imgview.o
SRCS2 = $(COMMONSRCS) simple_test.c
OBJS2 = $(COMMONOBJS) simple_test.o
SRCS3 = $(COMMONSRCS) damage_test.c
OBJS3 = $(COMMONOBJS) damage_test.o
SRCS4 = $(COMMONSRCS) transform_test.c
OBJS4 = $(COMMONSRCS) transform_test.o
SRCS5 = $(COMMONSRCS) viewporter_test.c
OBJS5 = $(COMMONSRCS) viewporter_test.o
SRCS6 = $(COMMONSRCS) subsurface_test.c
OBJS6 = $(COMMONSRCS) subsurface_test.o
SRCS7 = $(COMMONSRCS) scale_test.c
OBJS7 = $(COMMONSRCS) scale_test.o
SRCS8 = $(COMMONSRCS) seat_test.c
OBJS8 = $(COMMONSRCS) seat_test.o
PROGRAMS = imgview simple_test damage_test transform_test viewporter_test subsurface_test scale_test seat_test
/* Make all objects depend on HEADER. */
$(OBJS1): $(HEADER)
/* And depend on all sources and headers. */
depend:: $(HEADER) $(COMMONSRCS)
NormalProgramTarget(imgview,$(OBJS1),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(simple_test,$(OBJS2),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(damage_test,$(OBJS3),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(transform_test,$(OBJS4),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(viewporter_test,$(OBJS5),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(subsurface_test,$(OBJS6),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(scale_test,$(OBJS7),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
NormalProgramTarget(seat_test,$(OBJS8),NullParameter,$(LOCAL_LIBRARIES),NullParameter)
DependTarget3($(SRCS1),$(SRCS2),$(SRCS3))
DependTarget3($(SRCS4),$(SRCS5),$(SRCS6))
DependTarget3($(SRCS7),$(SRCS8),NullParameter)
all:: $(PROGRAMS)
clean::
$(RM) $(GENFILES)