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