[GTK] Run forwarding headers generator unconditionally
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformGTK.cmake
1 # This is necessary because it is possible to build TestWebKitAPI with WebKit2
2 # disabled and this triggers the inclusion of the WebKit2 headers.
3 add_definitions(-DBUILDING_WEBKIT2__)
4
5 add_custom_target(TestWebKitAPI-forwarding-headers
6     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk
7 )
8
9 set(ForwardingHeadersForTestWebKitAPI_NAME TestWebKitAPI-forwarding-headers)
10
11 include_directories(
12     ${FORWARDING_HEADERS_DIR}
13     ${WEBKIT2_DIR}/UIProcess/API/C/soup
14     ${WEBKIT2_DIR}/UIProcess/API/C/gtk
15     ${WEBKIT2_DIR}/UIProcess/API/gtk
16     ${GDK3_INCLUDE_DIRS}
17     ${GLIB_INCLUDE_DIRS}
18     ${GTK3_INCLUDE_DIRS}
19     ${LIBSOUP_INCLUDE_DIRS}
20 )
21 set(test_main_SOURCES
22     ${TESTWEBKITAPI_DIR}/gtk/main.cpp
23 )
24
25 set(bundle_harness_SOURCES
26     ${TESTWEBKITAPI_DIR}/gtk/InjectedBundleControllerGtk.cpp
27     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
28 )
29
30 set(webkit2_api_harness_SOURCES
31     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
32     ${TESTWEBKITAPI_DIR}/gtk/PlatformWebViewGtk.cpp
33 )
34
35 list(APPEND test_wtf_LIBRARIES
36     ${GDK3_LIBRARIES}
37     ${GTK3_LIBRARIES}
38 )
39
40 list(APPEND test_webkit2_api_LIBRARIES
41     ${GDK3_LIBRARIES}
42     ${GTK3_LIBRARIES}
43 )
44
45 list(APPEND test_webcore_LIBRARIES
46     WebCorePlatformGTK
47     ${GDK3_LIBRARIES}
48     ${GTK3_LIBRARIES}
49 )
50
51 list(APPEND TestWebKitAPI_LIBRARIES
52     ${GDK3_LIBRARIES}
53     ${GTK3_LIBRARIES}
54 )
55
56 list(APPEND TestJavaScriptCore_LIBRARIES
57     ${GDK3_LIBRARIES}
58     ${GTK3_LIBRARIES}
59 )
60
61 add_executable(TestWebKit2
62     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/AboutBlankLoad.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CookieManager.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
68     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DownloadDecideDestinationCrash.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/EvaluateJavaScript.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FailedLoad.cpp
71     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Find.cpp
72     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ForceRepaint.cpp
73     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypeHTML.cpp
74     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypePNG.cpp
75     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Geolocation.cpp
76     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp
77     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle.cpp
78     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic.cpp
79     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest.cpp
80     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp
81     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
82     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp
83     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadPageOnCrash.cpp
84     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash.cpp
85     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp
86     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp
87     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp
88     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp
89     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadBasic.cpp
90     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp
91     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame.cpp
92     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PreventEmptyUserAgent.cpp
93     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp
94     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ReloadPageAfterCrash.cpp
95     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResizeWindowAfterCrash.cpp
96     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp
97     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp
98     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMedia.cpp
99     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage.cpp
100     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent.cpp
101     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp
102     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp
103     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp
104     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp
105     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKURL.cpp
106     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/gtk/InputMethodFilter.cpp
107 )
108
109 target_link_libraries(TestWebKit2 ${test_webkit2_api_LIBRARIES})
110 add_test(TestWebKit2 ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/TestWebKit2)
111 set_tests_properties(TestWebKit2 PROPERTIES TIMEOUT 60)
112 set_target_properties(TestWebKit2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2)
113
114 set(TestWebCoreGtk_SOURCES
115     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gtk/UserAgentQuirks.cpp
116 )
117
118 add_executable(TestWebCore
119     ${test_main_SOURCES}
120     ${TestWebCoreGtk_SOURCES}
121     ${TESTWEBKITAPI_DIR}/TestsController.cpp
122     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
123     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
124 )
125
126 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
127 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
128
129 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
130 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
131 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
132
133 list(APPEND TestWTF_SOURCES
134     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GMainLoopSource.cpp
135     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GUniquePtr.cpp
136 )