1if ENABLE_WEBKIT2
2
3TEST_PROGS += \
4	Programs/WebKit2APITests/InspectorTestServer \
5	Programs/WebKit2APITests/TestBackForwardList \
6	Programs/WebKit2APITests/TestContextMenu \
7	Programs/WebKit2APITests/TestCookieManager \
8	Programs/WebKit2APITests/TestDownloads \
9	Programs/WebKit2APITests/TestInspector \
10	Programs/WebKit2APITests/TestInspectorServer \
11	Programs/WebKit2APITests/TestLoaderClient \
12	Programs/WebKit2APITests/TestPrinting \
13	Programs/WebKit2APITests/TestResources \
14	Programs/WebKit2APITests/TestSSL \
15	Programs/WebKit2APITests/TestWebExtensions \
16	Programs/WebKit2APITests/TestWebKitVersion \
17	Programs/WebKit2APITests/TestWebKitFaviconDatabase \
18	Programs/WebKit2APITests/TestWebKitFindController \
19	Programs/WebKit2APITests/TestWebKitPolicyClient \
20	Programs/WebKit2APITests/TestWebKitSettings \
21	Programs/WebKit2APITests/TestWebKitWebContext \
22	Programs/WebKit2APITests/TestWebKitWebView \
23	Programs/WebKit2APITests/TestWebKitWebViewGroup \
24	Programs/WebKit2APITests/TestWebViewEditor
25
26noinst_PROGRAMS += $(TEST_PROGS)
27
28if HAVE_ATSPI2
29TEST_PROGS += Programs/WebKit2APITests/TestWebKitAccessibility
30
31noinst_PROGRAMS += Programs/WebKit2APITests/AccessibilityTestServer
32endif
33
34webkit2_tests_cppflags = \
35	-DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs\" \
36	-DWEBKIT_SRC_DIR=\"${shell pwd}/${srcdir}\" \
37	-DWEBKIT_DERIVED_SRC_DIR=\"${shell pwd}/${top_builddir}/DerivedSources\" \
38	-DWEBKIT_TEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
39	-DWEBKIT_TEST_WEB_EXTENSIONS_DIR=\"${shell pwd}/${top_builddir}/Libraries/WebExtensions/.libs\" \
40	-DWEBKIT_INJECTED_BUNDLE_PATH=\"${shell pwd}/$(top_builddir)/.libs\" \
41	$(javascriptcore_cppflags) \
42	-I$(srcdir)/Source/JavaScriptCore \
43	-I$(srcdir)/Source \
44	-I$(srcdir)/Source/WebKit2 \
45	-I$(top_builddir)/DerivedSources/WebKit2/include \
46	-I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk \
47	-I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \
48	-I$(srcdir)/Source/WebKit2/UIProcess/API/gtk \
49	$(global_cppflags) \
50	$(FREETYPE_CFLAGS) \
51	$(GLIB_CFLAGS) \
52	$(GTK_CFLAGS) \
53	$(LIBSOUP_CFLAGS)
54
55webkit2_tests_ldadd = \
56	Libraries/libWebKit2APITestCore.la \
57	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
58	libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
59	$(FREETYPE_LIBS) \
60	$(GEOCLUE_LIBS) \
61	$(GLIB_LIBS) \
62	$(GTK_LIBS) \
63	$(LIBSOUP_LIBS)
64
65webkit2_tests_ldflags = \
66	-no-install \
67	-no-fast-install
68
69Programs/resources/webkit2gtk-tests-resources.gresource: Source/WebKit2/UIProcess/API/gtk/tests/resources/webkit2gtk-tests.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/Source/WebKit2/UIProcess/API/gtk/tests/resources/webkit2gtk-tests.gresource.xml)
70	$(AM_V_at)mkdir -p ${GENPROGRAMS}/resources
71	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) $<
72
73DISTCLEANFILES += Programs/resources/webkit2gtk-tests-resources.gresource
74noinst_DATA += Programs/resources/webkit2gtk-tests-resources.gresource
75
76noinst_LTLIBRARIES += Libraries/libWebKit2APITestCore.la
77Libraries_libWebKit2APITestCore_la_SOURCES = \
78	Source/WebKit2/UIProcess/API/gtk/tests/LoadTrackingTest.cpp \
79	Source/WebKit2/UIProcess/API/gtk/tests/LoadTrackingTest.h \
80	Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestBus.cpp \
81	Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestBus.h \
82	Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestServer.cpp \
83	Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestServer.h \
84	Source/WebKit2/UIProcess/API/gtk/tests/TestMain.cpp \
85	Source/WebKit2/UIProcess/API/gtk/tests/TestMain.h \
86	Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp \
87	Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
88Libraries_libWebKit2APITestCore_la_CPPFLAGS = $(webkit2_tests_cppflags)
89
90noinst_LTLIBRARIES += Libraries/WebExtensions/libWebExtensionTest.la
91Libraries_WebExtensions_libWebExtensionTest_la_SOURCES = \
92	Source/WebKit2/UIProcess/API/gtk/tests/WebExtensionTest.cpp
93
94Libraries_WebExtensions_libWebExtensionTest_la_LDFLAGS = \
95	-rpath ${shell pwd}/$(top_builddir)/Libraries/WebExtensions/.libs \
96	$(no_undefined) \
97	-avoid-version \
98	-module
99
100Libraries_WebExtensions_libWebExtensionTest_la_CPPFLAGS = \
101	-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/gtk \
102	-I$(top_builddir)/DerivedSources \
103	-I$(top_builddir)/DerivedSources/WebKit2/webkit2extension/include \
104	-DWEBKIT2_COMPILATION \
105	$(webkit2_tests_cppflags)
106
107Libraries_WebExtensions_libWebExtensionTest_la_CXXFLAGS = \
108        $(global_cxxflags)
109
110Libraries_WebExtensions_libWebExtensionTest_la_CFLAGS = \
111        $(global_cflags)
112
113
114EXTRA_DIST += \
115	Source/WebKit2/UIProcess/API/gtk/tests/resources/test-cert.pem \
116	Source/WebKit2/UIProcess/API/gtk/tests/resources/test-key.pem \
117	Source/WebKit2/UIProcess/API/gtk/tests/resources/webkit2gtk-tests.gresource.xml \
118	Source/WebKit2/UIProcess/API/gtk/tests/resources/link-title.js
119
120Programs_WebKit2APITests_TestWebKitWebContext_SOURCES = \
121	Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
122Programs_WebKit2APITests_TestWebKitWebContext_CPPFLAGS = $(webkit2_tests_cppflags)
123Programs_WebKit2APITests_TestWebKitWebContext_LDADD = $(webkit2_tests_ldadd)
124Programs_WebKit2APITests_TestWebKitWebContext_LDFLAGS = $(webkit2_tests_ldflags)
125
126Programs_WebKit2APITests_TestWebKitWebView_SOURCES = \
127	Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp
128Programs_WebKit2APITests_TestWebKitWebView_CPPFLAGS = $(webkit2_tests_cppflags)
129Programs_WebKit2APITests_TestWebKitWebView_LDADD = $(webkit2_tests_ldadd)
130Programs_WebKit2APITests_TestWebKitWebView_LDFLAGS = $(webkit2_tests_ldflags)
131
132Programs_WebKit2APITests_TestLoaderClient_SOURCES = \
133	Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp
134Programs_WebKit2APITests_TestLoaderClient_CPPFLAGS = $(webkit2_tests_cppflags)
135Programs_WebKit2APITests_TestLoaderClient_LDADD = $(webkit2_tests_ldadd)
136Programs_WebKit2APITests_TestLoaderClient_LDFLAGS = $(webkit2_tests_ldflags)
137
138Programs_WebKit2APITests_TestWebKitSettings_SOURCES = \
139	Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp
140Programs_WebKit2APITests_TestWebKitSettings_CPPFLAGS = $(webkit2_tests_cppflags)
141Programs_WebKit2APITests_TestWebKitSettings_LDADD = $(webkit2_tests_ldadd)
142Programs_WebKit2APITests_TestWebKitSettings_LDFLAGS = $(webkit2_tests_ldflags)
143
144Programs_WebKit2APITests_InspectorTestServer_SOURCES = \
145	Source/WebKit2/UIProcess/API/gtk/tests/InspectorTestServer.cpp
146Programs_WebKit2APITests_InspectorTestServer_CPPFLAGS = $(webkit2_tests_cppflags)
147Programs_WebKit2APITests_InspectorTestServer_LDADD = $(webkit2_tests_ldadd)
148Programs_WebKit2APITests_InspectorTestServer_LDFLAGS = $(webkit2_tests_ldflags)
149
150Programs_WebKit2APITests_TestBackForwardList_SOURCES = \
151        Source/WebKit2/UIProcess/API/gtk/tests/TestBackForwardList.cpp
152Programs_WebKit2APITests_TestBackForwardList_CPPFLAGS = $(webkit2_tests_cppflags)
153Programs_WebKit2APITests_TestBackForwardList_LDADD = $(webkit2_tests_ldadd)
154Programs_WebKit2APITests_TestBackForwardList_LDFLAGS = $(webkit2_tests_ldflags)
155
156Programs_WebKit2APITests_TestWebKitPolicyClient_SOURCES = \
157        Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitPolicyClient.cpp
158Programs_WebKit2APITests_TestWebKitPolicyClient_CPPFLAGS = $(webkit2_tests_cppflags)
159Programs_WebKit2APITests_TestWebKitPolicyClient_LDADD = $(webkit2_tests_ldadd)
160Programs_WebKit2APITests_TestWebKitPolicyClient_LDFLAGS = $(webkit2_tests_ldflags)
161
162if HAVE_ATSPI2
163Programs_WebKit2APITests_AccessibilityTestServer_SOURCES = \
164	Source/WebKit2/UIProcess/API/gtk/tests/AccessibilityTestServer.cpp
165Programs_WebKit2APITests_AccessibilityTestServer_CPPFLAGS = $(webkit2_tests_cppflags)
166Programs_WebKit2APITests_AccessibilityTestServer_LDADD = $(webkit2_tests_ldadd)
167Programs_WebKit2APITests_AccessibilityTestServer_LDFLAGS = $(webkit2_tests_ldflags)
168
169Programs_WebKit2APITests_TestWebKitAccessibility_SOURCES = \
170	Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp
171Programs_WebKit2APITests_TestWebKitAccessibility_CPPFLAGS = $(webkit2_tests_cppflags) $(ATSPI2_CFLAGS)
172Programs_WebKit2APITests_TestWebKitAccessibility_LDADD = $(webkit2_tests_ldadd) $(ATSPI2_LIBS)
173Programs_WebKit2APITests_TestWebKitAccessibility_LDFLAGS = $(webkit2_tests_ldflags)
174endif
175
176Programs_WebKit2APITests_TestDownloads_SOURCES = \
177        Source/WebKit2/UIProcess/API/gtk/tests/TestDownloads.cpp
178Programs_WebKit2APITests_TestDownloads_CPPFLAGS = $(webkit2_tests_cppflags)
179Programs_WebKit2APITests_TestDownloads_LDADD = $(webkit2_tests_ldadd)
180Programs_WebKit2APITests_TestDownloads_LDFLAGS = $(webkit2_tests_ldflags)
181
182Programs_WebKit2APITests_TestWebViewEditor_SOURCES = \
183        Source/WebKit2/UIProcess/API/gtk/tests/TestWebViewEditor.cpp
184Programs_WebKit2APITests_TestWebViewEditor_CPPFLAGS = $(webkit2_tests_cppflags)
185Programs_WebKit2APITests_TestWebViewEditor_LDADD = $(webkit2_tests_ldadd)
186Programs_WebKit2APITests_TestWebViewEditor_LDFLAGS = $(webkit2_tests_ldflags)
187
188Programs_WebKit2APITests_TestPrinting_SOURCES = \
189        Source/WebKit2/UIProcess/API/gtk/tests/TestPrinting.cpp
190Programs_WebKit2APITests_TestPrinting_CPPFLAGS = $(webkit2_tests_cppflags) $(GTK_UNIX_PRINTING_CFLAGS)
191Programs_WebKit2APITests_TestPrinting_LDADD = $(webkit2_tests_ldadd) $(GTK_UNIX_PRINTING_LIBS)
192Programs_WebKit2APITests_TestPrinting_LDFLAGS = $(webkit2_tests_ldflags)
193
194Programs_WebKit2APITests_TestWebKitFaviconDatabase_SOURCES = \
195	Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFaviconDatabase.cpp
196Programs_WebKit2APITests_TestWebKitFaviconDatabase_CPPFLAGS = $(webkit2_tests_cppflags)
197Programs_WebKit2APITests_TestWebKitFaviconDatabase_LDADD = $(webkit2_tests_ldadd)
198Programs_WebKit2APITests_TestWebKitFaviconDatabase_LDFLAGS = $(webkit2_tests_ldflags)
199
200Programs_WebKit2APITests_TestWebKitFindController_SOURCES = \
201	Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFindController.cpp
202Programs_WebKit2APITests_TestWebKitFindController_CPPFLAGS = $(webkit2_tests_cppflags)
203Programs_WebKit2APITests_TestWebKitFindController_LDADD = $(webkit2_tests_ldadd)
204Programs_WebKit2APITests_TestWebKitFindController_LDFLAGS = $(webkit2_tests_ldflags)
205
206Programs_WebKit2APITests_TestResources_SOURCES = \
207        Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp
208Programs_WebKit2APITests_TestResources_CPPFLAGS = $(webkit2_tests_cppflags)
209Programs_WebKit2APITests_TestResources_LDADD = $(webkit2_tests_ldadd)
210Programs_WebKit2APITests_TestResources_LDFLAGS = $(webkit2_tests_ldflags)
211
212Programs_WebKit2APITests_TestCookieManager_SOURCES = \
213        Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp
214Programs_WebKit2APITests_TestCookieManager_CPPFLAGS = $(webkit2_tests_cppflags)
215Programs_WebKit2APITests_TestCookieManager_LDADD = $(webkit2_tests_ldadd)
216Programs_WebKit2APITests_TestCookieManager_LDFLAGS = $(webkit2_tests_ldflags)
217
218Programs_WebKit2APITests_TestInspector_SOURCES = \
219        Source/WebKit2/UIProcess/API/gtk/tests/TestInspector.cpp
220Programs_WebKit2APITests_TestInspector_CPPFLAGS = \
221	-DWEBKIT_INSPECTOR_PATH=\"${shell pwd}/${top_builddir}/resources/inspector\" \
222	$(webkit2_tests_cppflags)
223Programs_WebKit2APITests_TestInspector_LDADD = $(webkit2_tests_ldadd)
224Programs_WebKit2APITests_TestInspector_LDFLAGS = $(webkit2_tests_ldflags)
225
226Programs_WebKit2APITests_TestInspectorServer_SOURCES = \
227	Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp
228Programs_WebKit2APITests_TestInspectorServer_CPPFLAGS = $(webkit2_tests_cppflags)
229Programs_WebKit2APITests_TestInspectorServer_LDADD = $(webkit2_tests_ldadd)
230Programs_WebKit2APITests_TestInspectorServer_LDFLAGS = $(webkit2_tests_ldflags)
231
232Programs_WebKit2APITests_TestWebKitVersion_SOURCES = \
233        Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitVersion.cpp
234Programs_WebKit2APITests_TestWebKitVersion_CPPFLAGS = $(webkit2_tests_cppflags)
235Programs_WebKit2APITests_TestWebKitVersion_LDADD = $(webkit2_tests_ldadd)
236Programs_WebKit2APITests_TestWebKitVersion_LDFLAGS = $(webkit2_tests_ldflags)
237
238Programs_WebKit2APITests_TestContextMenu_SOURCES = \
239        Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp
240Programs_WebKit2APITests_TestContextMenu_CPPFLAGS = $(webkit2_tests_cppflags)
241Programs_WebKit2APITests_TestContextMenu_LDADD = $(webkit2_tests_ldadd)
242Programs_WebKit2APITests_TestContextMenu_LDFLAGS = $(webkit2_tests_ldflags)
243
244Programs_WebKit2APITests_TestSSL_SOURCES = \
245        Source/WebKit2/UIProcess/API/gtk/tests/TestSSL.cpp
246Programs_WebKit2APITests_TestSSL_CPPFLAGS = $(webkit2_tests_cppflags)
247Programs_WebKit2APITests_TestSSL_LDADD = $(webkit2_tests_ldadd)
248Programs_WebKit2APITests_TestSSL_LDFLAGS = $(webkit2_tests_ldflags)
249
250Programs_WebKit2APITests_TestWebExtensions_SOURCES = \
251        Source/WebKit2/UIProcess/API/gtk/tests/TestWebExtensions.cpp
252Programs_WebKit2APITests_TestWebExtensions_CPPFLAGS = $(webkit2_tests_cppflags)
253Programs_WebKit2APITests_TestWebExtensions_LDADD = $(webkit2_tests_ldadd)
254Programs_WebKit2APITests_TestWebExtensions_LDFLAGS = $(webkit2_tests_ldflags)
255
256Programs_WebKit2APITests_TestWebKitWebViewGroup_SOURCES = \
257        Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebViewGroup.cpp
258Programs_WebKit2APITests_TestWebKitWebViewGroup_CPPFLAGS = $(webkit2_tests_cppflags)
259Programs_WebKit2APITests_TestWebKitWebViewGroup_LDADD = $(webkit2_tests_ldadd)
260Programs_WebKit2APITests_TestWebKitWebViewGroup_LDFLAGS = $(webkit2_tests_ldflags)
261
262endif # ENABLE_WEBKIT2
263