build: Move src/Makefile.am into toplevel Makefile.am
[platform/upstream/weston.git] / tests / Makefile.am
1 TESTS = $(shared_tests) $(module_tests) $(weston_tests)
2
3 shared_tests = \
4         config-parser.test              \
5         vertex-clip.test
6
7 module_tests =                          \
8         surface-test.la                 \
9         surface-global-test.la
10
11 weston_tests =                          \
12         bad_buffer.weston               \
13         keyboard.weston                 \
14         event.weston                    \
15         button.weston                   \
16         text.weston                     \
17         subsurface.weston               \
18         $(xwayland_test)
19
20 if ENABLE_EGL
21 weston_tests +=                         \
22         buffer-count.weston
23 endif
24
25 AM_TESTS_ENVIRONMENT = \
26         abs_builddir='$(abs_builddir)'; export abs_builddir;
27
28 TEST_EXTENSIONS = .la .weston
29 LA_LOG_COMPILER = $(srcdir)/weston-tests-env
30 WESTON_LOG_COMPILER = $(srcdir)/weston-tests-env
31
32 clean-local:
33         -rm -rf logs
34
35 # To remove when automake 1.11 support is dropped
36 export abs_builddir
37
38 noinst_LTLIBRARIES =                    \
39         weston-test.la                  \
40         $(module_tests)                 \
41         libtest-runner.la               \
42         libtest-client.la
43
44 noinst_PROGRAMS =                       \
45         $(setbacklight)                 \
46         $(shared_tests)                 \
47         $(weston_tests)                 \
48         matrix-test
49
50 AM_CFLAGS = $(GCC_CFLAGS)
51 AM_CPPFLAGS =                                   \
52         -I$(top_srcdir)/src                     \
53         -I$(top_srcdir)/shared                  \
54         -I$(top_builddir)/src                   \
55         $(COMPOSITOR_CFLAGS)
56
57 surface_global_test_la_SOURCES = surface-global-test.c
58 surface_global_test_la_LDFLAGS = -module -avoid-version -rpath $(libdir)
59 surface_test_la_SOURCES = surface-test.c
60 surface_test_la_LDFLAGS = -module -avoid-version -rpath $(libdir)
61
62 weston_test_la_LIBADD = $(COMPOSITOR_LIBS) ../shared/libshared.la
63 weston_test_la_LDFLAGS = -module -avoid-version -rpath $(libdir)
64 weston_test_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
65 weston_test_la_SOURCES =                \
66         weston-test.c                   \
67         wayland-test-protocol.c         \
68         wayland-test-server-protocol.h
69
70 if ENABLE_EGL
71 weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS)
72 weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS)
73 endif
74
75 libtest_runner_la_SOURCES =     \
76         weston-test-runner.c    \
77         weston-test-runner.h
78 libtest_runner_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
79
80 config_parser_test_LDADD =      \
81         ../shared/libshared.la  \
82         libtest-runner.la       \
83         $(COMPOSITOR_LIBS)
84 config_parser_test_SOURCES =    \
85         config-parser-test.c
86
87 vertex_clip_test_SOURCES =              \
88         vertex-clip-test.c              \
89         ../src/vertex-clipping.c        \
90         ../src/vertex-clipping.h
91 vertex_clip_test_LDADD =        \
92         libtest-runner.la       \
93         -lm -lrt
94
95 libtest_client_la_SOURCES =             \
96         weston-test-client-helper.c     \
97         weston-test-client-helper.h     \
98         wayland-test-protocol.c         \
99         wayland-test-client-protocol.h
100 libtest_client_la_LIBADD =              \
101         $(TEST_CLIENT_LIBS)             \
102         ../shared/libshared.la          \
103         libtest-runner.la
104
105 bad_buffer_weston_SOURCES = bad-buffer-test.c
106 bad_buffer_weston_LDADD = libtest-client.la
107
108 keyboard_weston_SOURCES = keyboard-test.c
109 keyboard_weston_LDADD = libtest-client.la
110
111 event_weston_SOURCES = event-test.c
112 event_weston_LDADD = libtest-client.la
113
114 button_weston_SOURCES = button-test.c
115 button_weston_LDADD = libtest-client.la
116
117 text_weston_SOURCES = text-test.c text-protocol.c
118 text_weston_LDADD = libtest-client.la
119
120 subsurface_weston_SOURCES = subsurface-test.c
121 subsurface_weston_LDADD = libtest-client.la
122
123 buffer_count_weston_SOURCES = buffer-count-test.c
124 buffer_count_weston_CFLAGS = $(GCC_CFLAGS) $(EGL_TESTS_CFLAGS)
125 buffer_count_weston_LDADD = libtest-client.la $(EGL_TESTS_LIBS)
126
127 xwayland_weston_SOURCES = xwayland-test.c
128 xwayland_weston_CFLAGS = $(GCC_CFLAGS) $(XWAYLAND_TEST_CFLAGS)
129 xwayland_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
130
131 if ENABLE_XWAYLAND_TEST
132 xwayland_test = xwayland.weston
133 endif
134
135 matrix_test_CPPFLAGS = -DUNIT_TEST
136 matrix_test_SOURCES =                           \
137         matrix-test.c                           \
138         ../shared/matrix.c                      \
139         ../shared/matrix.h
140 matrix_test_LDADD = -lm -lrt
141
142 setbacklight_SOURCES =                          \
143         setbacklight.c                          \
144         ../src/libbacklight.c                   \
145         ..//src/libbacklight.h
146
147 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
148 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
149
150 if BUILD_SETBACKLIGHT
151 setbacklight = setbacklight
152 endif
153
154 EXTRA_DIST = weston-tests-env
155
156 BUILT_SOURCES =                                 \
157         wayland-test-protocol.c                 \
158         wayland-test-server-protocol.h          \
159         wayland-test-client-protocol.h          \
160         text-protocol.c                         \
161         text-client-protocol.h
162
163 CLEANFILES = $(BUILT_SOURCES)
164
165 wayland_protocoldir = $(top_srcdir)/protocol
166 include $(top_srcdir)/wayland-scanner.mk