tests: use variable for test name in weston-tests-env
[platform/upstream/weston.git] / tests / Makefile.am
1 TESTS = $(shared_tests) $(module_tests) $(weston_tests)
2
3 shared_tests = \
4         config-parser.test
5
6 module_tests =                          \
7         surface-test.la                 \
8         surface-global-test.la
9
10 weston_tests =                          \
11         keyboard.weston                 \
12         event.weston                    \
13         button.weston                   \
14         text.weston                     \
15         subsurface.weston               \
16         $(xwayland_test)
17
18 AM_TESTS_ENVIRONMENT = \
19         abs_builddir='$(abs_builddir)'; export abs_builddir;
20
21 TEST_EXTENSIONS = .la .weston
22 LA_LOG_COMPILER = $(srcdir)/weston-tests-env
23 WESTON_LOG_COMPILER = $(srcdir)/weston-tests-env
24
25 clean-local:
26         -rm -rf logs
27
28 # To remove when automake 1.11 support is dropped
29 export abs_builddir
30
31 noinst_LTLIBRARIES =                    \
32         $(weston_test)                  \
33         $(module_tests)
34
35 noinst_PROGRAMS =                       \
36         $(setbacklight)                 \
37         $(shared_tests)                 \
38         $(weston_tests)                 \
39         matrix-test
40
41 AM_CFLAGS = $(GCC_CFLAGS)
42 AM_CPPFLAGS =                                   \
43         -I$(top_srcdir)/src                     \
44         -I$(top_srcdir)/shared                  \
45         -I$(top_builddir)/src                   \
46         -DUNIT_TEST                             \
47         $(COMPOSITOR_CFLAGS)
48 AM_LDFLAGS = -module -avoid-version -rpath $(libdir)
49
50 config_parser_test_LDADD =      \
51         ../shared/libshared.la  \
52         $(COMPOSITOR_LIBS)
53 config_parser_test_SOURCES =    \
54         config-parser-test.c
55
56 surface_global_test_la_SOURCES = surface-global-test.c
57 surface_test_la_SOURCES = surface-test.c
58
59 weston_test = weston-test.la
60 weston_test_la_LIBADD = $(COMPOSITOR_LIBS)      \
61         ../shared/libshared.la
62 weston_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
63 weston_test_la_SOURCES =                \
64         weston-test.c                   \
65         wayland-test-protocol.c         \
66         wayland-test-server-protocol.h
67
68 weston_test_runner_src =                \
69         weston-test-runner.c            \
70         weston-test-runner.h
71 weston_test_client_src =                \
72         weston-test-client-helper.c     \
73         weston-test-client-helper.h     \
74         wayland-test-protocol.c         \
75         wayland-test-client-protocol.h  \
76         subsurface-protocol.c           \
77         subsurface-client-protocol.h    \
78         $(weston_test_runner_src)
79 weston_test_client_libs =               \
80         $(SIMPLE_CLIENT_LIBS)           \
81         ../shared/libshared.la
82
83 keyboard_weston_SOURCES = keyboard-test.c $(weston_test_client_src)
84 keyboard_weston_LDADD = $(weston_test_client_libs)
85
86 event_weston_SOURCES = event-test.c $(weston_test_client_src)
87 event_weston_LDADD = $(weston_test_client_libs)
88
89 button_weston_SOURCES = button-test.c $(weston_test_client_src)
90 button_weston_LDADD = $(weston_test_client_libs)
91
92 text_weston_SOURCES =                           \
93         text-test.c                             \
94         ../clients/text-protocol.c              \
95         $(weston_test_client_src)
96 text_weston_LDADD = $(weston_test_client_libs)
97
98 subsurface_weston_SOURCES = subsurface-test.c $(weston_test_client_src)
99 subsurface_weston_LDADD = $(weston_test_client_libs)
100
101 xwayland_weston_SOURCES = xwayland-test.c       $(weston_test_client_src)
102
103 xwayland_weston_LDADD = $(weston_test_client_libs) $(XWAYLAND_TEST_LIBS)
104
105 if ENABLE_XWAYLAND_TEST
106 xwayland_test = xwayland.weston
107 endif
108
109 matrix_test_SOURCES =                           \
110         matrix-test.c                           \
111         $(top_srcdir)/shared/matrix.c           \
112         $(top_srcdir)/shared/matrix.h
113 matrix_test_LDADD = -lm -lrt
114
115 setbacklight_SOURCES =                          \
116         setbacklight.c                          \
117         $(top_srcdir)/src/libbacklight.c        \
118         $(top_srcdir)/src/libbacklight.h
119
120 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
121 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
122
123 if BUILD_SETBACKLIGHT
124 setbacklight = setbacklight
125 endif
126
127 EXTRA_DIST = weston-tests-env
128
129 BUILT_SOURCES =                                 \
130         subsurface-protocol.c                   \
131         subsurface-client-protocol.h            \
132         wayland-test-protocol.c                 \
133         wayland-test-server-protocol.h          \
134         wayland-test-client-protocol.h
135
136 CLEANFILES = $(BUILT_SOURCES)
137
138 wayland_protocoldir = $(top_srcdir)/protocol
139 include $(top_srcdir)/wayland-scanner.mk