6231e16195f514bbff703ccf3d0a18a1863dd3d9
[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 WebKit
5 # disabled and this triggers the inclusion of the WebKit headers.
6 add_definitions(-DBUILDING_WEBKIT2__)
7
8 add_custom_target(TestWebKitAPI-forwarding-headers
9     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
10     DEPENDS WebKit-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     ${WEBKIT_DIR}/UIProcess/API/C/soup
19     ${WEBKIT_DIR}/UIProcess/API/C/gtk
20     ${WEBKIT_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(webkit_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_webkit_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(TestWebKit
72     ${TESTWEBKITAPI_DIR}/Tests/WebKit/AboutBlankLoad.cpp
73     ${TESTWEBKITAPI_DIR}/Tests/WebKit/CanHandleRequest.cpp
74     ${TESTWEBKITAPI_DIR}/Tests/WebKit/CookieManager.cpp
75     ${TESTWEBKITAPI_DIR}/Tests/WebKit/DocumentStartUserScriptAlertCrash.cpp
76     ${TESTWEBKITAPI_DIR}/Tests/WebKit/DOMWindowExtensionBasic.cpp
77     ${TESTWEBKITAPI_DIR}/Tests/WebKit/DOMWindowExtensionNoCache.cpp
78     ${TESTWEBKITAPI_DIR}/Tests/WebKit/DownloadDecideDestinationCrash.cpp
79     ${TESTWEBKITAPI_DIR}/Tests/WebKit/EnumerateMediaDevices.cpp
80     ${TESTWEBKITAPI_DIR}/Tests/WebKit/EvaluateJavaScript.cpp
81     ${TESTWEBKITAPI_DIR}/Tests/WebKit/FailedLoad.cpp
82     ${TESTWEBKITAPI_DIR}/Tests/WebKit/Find.cpp
83     ${TESTWEBKITAPI_DIR}/Tests/WebKit/ForceRepaint.cpp
84     ${TESTWEBKITAPI_DIR}/Tests/WebKit/FrameMIMETypeHTML.cpp
85     ${TESTWEBKITAPI_DIR}/Tests/WebKit/FrameMIMETypePNG.cpp
86     ${TESTWEBKITAPI_DIR}/Tests/WebKit/Geolocation.cpp
87     ${TESTWEBKITAPI_DIR}/Tests/WebKit/GetInjectedBundleInitializationUserDataCallback.cpp
88     ${TESTWEBKITAPI_DIR}/Tests/WebKit/HitTestResultNodeHandle.cpp
89     ${TESTWEBKITAPI_DIR}/Tests/WebKit/InjectedBundleBasic.cpp
90     ${TESTWEBKITAPI_DIR}/Tests/WebKit/InjectedBundleFrameHitTest.cpp
91     ${TESTWEBKITAPI_DIR}/Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins.cpp
92     ${TESTWEBKITAPI_DIR}/Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
93     ${TESTWEBKITAPI_DIR}/Tests/WebKit/LoadCanceledNoServerRedirectCallback.cpp
94     ${TESTWEBKITAPI_DIR}/Tests/WebKit/LoadPageOnCrash.cpp
95     ${TESTWEBKITAPI_DIR}/Tests/WebKit/MouseMoveAfterCrash.cpp
96     ${TESTWEBKITAPI_DIR}/Tests/WebKit/NewFirstVisuallyNonEmptyLayout.cpp
97     ${TESTWEBKITAPI_DIR}/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails.cpp
98     ${TESTWEBKITAPI_DIR}/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages.cpp
99     ${TESTWEBKITAPI_DIR}/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp
100     ${TESTWEBKITAPI_DIR}/Tests/WebKit/PageLoadBasic.cpp
101     ${TESTWEBKITAPI_DIR}/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp
102     ${TESTWEBKITAPI_DIR}/Tests/WebKit/ParentFrame.cpp
103     ${TESTWEBKITAPI_DIR}/Tests/WebKit/PendingAPIRequestURL.cpp
104     ${TESTWEBKITAPI_DIR}/Tests/WebKit/PreventEmptyUserAgent.cpp
105     ${TESTWEBKITAPI_DIR}/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp
106     ${TESTWEBKITAPI_DIR}/Tests/WebKit/ProvisionalURLAfterWillSendRequestCallback.cpp
107     ${TESTWEBKITAPI_DIR}/Tests/WebKit/ReloadPageAfterCrash.cpp
108     ${TESTWEBKITAPI_DIR}/Tests/WebKit/ResizeWindowAfterCrash.cpp
109     ${TESTWEBKITAPI_DIR}/Tests/WebKit/RestoreSessionStateContainingFormData.cpp
110     ${TESTWEBKITAPI_DIR}/Tests/WebKit/ShouldGoToBackForwardListItem.cpp
111     ${TESTWEBKITAPI_DIR}/Tests/WebKit/TextFieldDidBeginAndEndEditing.cpp
112     ${TESTWEBKITAPI_DIR}/Tests/WebKit/UserMedia.cpp
113     ${TESTWEBKITAPI_DIR}/Tests/WebKit/UserMessage.cpp
114     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WillSendSubmitEvent.cpp
115     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPageCopySessionStateWithFiltering.cpp
116     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPageGetScaleFactorNotZero.cpp
117     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPreferences.cpp
118     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKRetainPtr.cpp
119     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKString.cpp
120     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKStringJSString.cpp
121     ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKURL.cpp
122     ${TESTWEBKITAPI_DIR}/Tests/WebKit/gtk/InputMethodFilter.cpp
123 )
124
125 target_link_libraries(TestWebKit ${test_webkit_api_LIBRARIES})
126 add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit/TestWebKit)
127 set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
128 set_target_properties(TestWebKit PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit)
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/MIMETypeRegistry.cpp
140     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
141     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SecurityOrigin.cpp
142     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
143     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
144     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
145     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URLParser.cpp
146     ${TESTWEBKITAPI_DIR}/Tests/WebCore/UserAgentQuirks.cpp
147 )
148
149 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
150 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
151
152 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
153 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
154 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
155
156 list(APPEND TestWTF_SOURCES
157     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
158     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
159 )
160
161 if (COMPILER_IS_GCC_OR_CLANG)
162     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKit -Wno-sign-compare
163                                            -Wno-undef
164                                            -Wno-unused-parameter)
165
166     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebCore -Wno-sign-compare
167                                             -Wno-undef
168                                             -Wno-unused-parameter)
169 endif ()