[JSC] Compress Watchpoint size by using enum type and Packed<> data structure
[WebKit-https.git] / Tools / TestWebKitAPI / CMakeLists.txt
1 set(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
2
3 get_property(gtest_DEFINITIONS GLOBAL PROPERTY gtest_DEFINITIONS)
4 add_definitions(${gtest_DEFINITIONS})
5
6 macro(WEBKIT_TEST _target)
7     WEBKIT_EXECUTABLE(${_target})
8     add_test(${_target} ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/${_target})
9     set_tests_properties(${_target} PROPERTIES TIMEOUT 60)
10     set_target_properties(${_target} PROPERTIES
11         RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}
12     )
13
14     if (COMPILER_IS_GCC_OR_CLANG)
15         WEBKIT_ADD_TARGET_CXX_FLAGS(${_target} -Wno-dangling-else
16                                                -Wno-sign-compare
17                                                -Wno-undef
18                                                -Wno-unused-parameter)
19     endif ()
20 endmacro()
21
22 # TestWTF definitions
23 set(TestWTF_SOURCES
24     Counters.cpp
25     TestsController.cpp
26
27     Tests/WTF/AtomicString.cpp
28     Tests/WTF/BloomFilter.cpp
29     Tests/WTF/CString.cpp
30     Tests/WTF/CheckedArithmeticOperations.cpp
31     Tests/WTF/ConcurrentPtrHashSet.cpp
32     Tests/WTF/Condition.cpp
33     Tests/WTF/CrossThreadTask.cpp
34     Tests/WTF/DateMath.cpp
35     Tests/WTF/Deque.cpp
36     Tests/WTF/EnumTraits.cpp
37     Tests/WTF/Expected.cpp
38     Tests/WTF/FileSystem.cpp
39     Tests/WTF/Function.cpp
40     Tests/WTF/HashCountedSet.cpp
41     Tests/WTF/HashMap.cpp
42     Tests/WTF/HashSet.cpp
43     Tests/WTF/Hasher.cpp
44     Tests/WTF/IntegerToStringConversion.cpp
45     Tests/WTF/IteratorRange.cpp
46     Tests/WTF/JSONValue.cpp
47     Tests/WTF/LEBDecoder.cpp
48     Tests/WTF/LifecycleLogger.cpp
49     Tests/WTF/LineEnding.cpp
50     Tests/WTF/ListHashSet.cpp
51     Tests/WTF/Lock.cpp
52     Tests/WTF/Logger.cpp
53     Tests/WTF/MD5.cpp
54     Tests/WTF/Markable.cpp
55     Tests/WTF/MathExtras.cpp
56     Tests/WTF/MediaTime.cpp
57     Tests/WTF/MetaAllocator.cpp
58     Tests/WTF/MoveOnlyLifecycleLogger.cpp
59     Tests/WTF/NakedPtr.cpp
60     Tests/WTF/NeverDestroyed.cpp
61     Tests/WTF/OptionSet.cpp
62     Tests/WTF/Optional.cpp
63     Tests/WTF/Packed.cpp
64     Tests/WTF/ParkingLot.cpp
65     Tests/WTF/PriorityQueue.cpp
66     Tests/WTF/RedBlackTree.cpp
67     Tests/WTF/Ref.cpp
68     Tests/WTF/RefCounter.cpp
69     Tests/WTF/RefLogger.cpp
70     Tests/WTF/RefPtr.cpp
71     Tests/WTF/RunLoop.cpp
72     Tests/WTF/SHA1.cpp
73     Tests/WTF/SaturatedArithmeticOperations.cpp
74     Tests/WTF/Scope.cpp
75     Tests/WTF/ScopedLambda.cpp
76     Tests/WTF/SetForScope.cpp
77     Tests/WTF/StringBuilder.cpp
78     Tests/WTF/StringConcatenate.cpp
79     Tests/WTF/StringHasher.cpp
80     Tests/WTF/StringImpl.cpp
81     Tests/WTF/StringOperators.cpp
82     Tests/WTF/StringView.cpp
83     Tests/WTF/SynchronizedFixedQueue.cpp
84     Tests/WTF/TextBreakIterator.cpp
85     Tests/WTF/ThreadGroup.cpp
86     Tests/WTF/ThreadMessages.cpp
87     Tests/WTF/Threading.cpp
88     Tests/WTF/Time.cpp
89     Tests/WTF/URL.cpp
90     Tests/WTF/URLParser.cpp
91     Tests/WTF/UniqueArray.cpp
92     Tests/WTF/UniqueRef.cpp
93     Tests/WTF/Variant.cpp
94     Tests/WTF/Vector.cpp
95     Tests/WTF/WTFString.cpp
96     Tests/WTF/WeakPtr.cpp
97     Tests/WTF/WorkQueue.cpp
98     Tests/WTF/WorkerPool.cpp
99 )
100
101 set(TestWTF_PRIVATE_INCLUDE_DIRECTORIES
102     ${CMAKE_BINARY_DIR}
103     ${TESTWEBKITAPI_DIR}
104     ${THIRDPARTY_DIR}/gtest/include
105     ${WTF_FRAMEWORK_HEADERS_DIR}
106 )
107
108 set(TestWTF_LIBRARIES
109     WTF
110     gtest
111 )
112
113 set(TestWTF_DEPENDENCIES WTFFrameworkHeaders)
114
115 WEBKIT_EXECUTABLE_DECLARE(TestWTF)
116
117 # TestWebCore definitions
118 if (ENABLE_WEBCORE)
119     set(TestWebCore_SOURCES
120         TestsController.cpp
121
122         Tests/WebCore/AffineTransform.cpp
123         Tests/WebCore/CSSParser.cpp
124         Tests/WebCore/CalculationValue.cpp
125         Tests/WebCore/ComplexTextController.cpp
126         Tests/WebCore/FileMonitor.cpp
127         Tests/WebCore/FloatPoint.cpp
128         Tests/WebCore/FloatRect.cpp
129         Tests/WebCore/FloatSize.cpp
130         Tests/WebCore/GridPosition.cpp
131         Tests/WebCore/HTMLParserIdioms.cpp
132         Tests/WebCore/IntPoint.cpp
133         Tests/WebCore/IntRect.cpp
134         Tests/WebCore/IntSize.cpp
135         Tests/WebCore/LayoutUnit.cpp
136         Tests/WebCore/MIMETypeRegistry.cpp
137         Tests/WebCore/ParsedContentRange.cpp
138         Tests/WebCore/PublicSuffix.cpp
139         Tests/WebCore/SecurityOrigin.cpp
140         Tests/WebCore/SharedBuffer.cpp
141         Tests/WebCore/SharedBufferTest.cpp
142         Tests/WebCore/TimeRanges.cpp
143         Tests/WebCore/TransformationMatrix.cpp
144         Tests/WebCore/URLParserTextEncoding.cpp
145     )
146
147     set(TestWebCore_LIBRARIES
148         WebCore
149         WebCoreTestSupport
150         gtest
151     )
152
153     set(TestWebCore_PRIVATE_INCLUDE_DIRECTORIES
154         ${CMAKE_BINARY_DIR}
155         ${TESTWEBKITAPI_DIR}
156         ${THIRDPARTY_DIR}/gtest/include
157         ${PAL_FRAMEWORK_HEADERS_DIR}
158         ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
159         ${WTF_FRAMEWORK_HEADERS_DIR}
160     )
161
162     set(TestWebCore_DEPENDENCIES WebCorePrivateFrameworkHeaders)
163
164     WEBKIT_EXECUTABLE_DECLARE(TestWebCore)
165 endif ()
166
167 # TestWebKitLegacy definitions
168 if (ENABLE_WEBKIT_LEGACY)
169     set(TestWebKitLegacy_SOURCES
170         TestsController.cpp
171     )
172
173     set(TestWebKitLegacy_LIBRARIES
174         WebKitLegacy
175         gtest
176     )
177
178     set(TestWebKitLegacy_PRIVATE_INCLUDE_DIRECTORIES
179         ${CMAKE_BINARY_DIR}
180         ${TESTWEBKITAPI_DIR}
181         ${THIRDPARTY_DIR}/gtest/include
182         ${PAL_FRAMEWORK_HEADERS_DIR}
183         ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
184         ${WTF_FRAMEWORK_HEADERS_DIR}
185         ${WebKitLegacy_FRAMEWORK_HEADERS_DIR}
186     )
187
188     set(TestWebKitLegacy_DEPENDENCIES WebKitLegacyFrameworkHeaders)
189
190     WEBKIT_EXECUTABLE_DECLARE(TestWebKitLegacy)
191 endif ()
192
193 # TestWebKit definitions
194 if (ENABLE_WEBKIT)
195     set(TestWebKit_SOURCES
196         Tests/WebKit/AboutBlankLoad.cpp
197         Tests/WebKit/CanHandleRequest.cpp
198         Tests/WebKit/CookieManager.cpp
199         Tests/WebKit/DOMWindowExtensionBasic.cpp
200         Tests/WebKit/DOMWindowExtensionNoCache.cpp
201         Tests/WebKit/DocumentStartUserScriptAlertCrash.cpp
202         Tests/WebKit/DownloadDecideDestinationCrash.cpp
203         Tests/WebKit/EnumerateMediaDevices.cpp
204         Tests/WebKit/EvaluateJavaScript.cpp
205         Tests/WebKit/FailedLoad.cpp
206         Tests/WebKit/Find.cpp
207         Tests/WebKit/FirstMeaningfulPaintMilestone.cpp
208         Tests/WebKit/ForceRepaint.cpp
209         Tests/WebKit/FrameMIMETypeHTML.cpp
210         Tests/WebKit/FrameMIMETypePNG.cpp
211         Tests/WebKit/Geolocation.cpp
212         Tests/WebKit/GetInjectedBundleInitializationUserDataCallback.cpp
213         Tests/WebKit/HitTestResultNodeHandle.cpp
214         Tests/WebKit/InjectedBundleBasic.cpp
215         Tests/WebKit/InjectedBundleFrameHitTest.cpp
216         Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins.cpp
217         Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
218         Tests/WebKit/LoadCanceledNoServerRedirectCallback.cpp
219         Tests/WebKit/LoadPageOnCrash.cpp
220         Tests/WebKit/MouseMoveAfterCrash.cpp
221         Tests/WebKit/NewFirstVisuallyNonEmptyLayout.cpp
222         Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails.cpp
223         Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages.cpp
224         Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp
225         Tests/WebKit/PageLoadBasic.cpp
226         Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp
227         Tests/WebKit/ParentFrame.cpp
228         Tests/WebKit/PendingAPIRequestURL.cpp
229         Tests/WebKit/PreventEmptyUserAgent.cpp
230         Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp
231         Tests/WebKit/ProvisionalURLAfterWillSendRequestCallback.cpp
232         Tests/WebKit/ReloadPageAfterCrash.cpp
233         Tests/WebKit/ResizeWindowAfterCrash.cpp
234         Tests/WebKit/RestoreSessionStateContainingFormData.cpp
235         Tests/WebKit/TextFieldDidBeginAndEndEditing.cpp
236         Tests/WebKit/UserMedia.cpp
237         Tests/WebKit/UserMessage.cpp
238         Tests/WebKit/WKPageCopySessionStateWithFiltering.cpp
239         Tests/WebKit/WKPageGetScaleFactorNotZero.cpp
240         Tests/WebKit/WKPreferences.cpp
241         Tests/WebKit/WKRetainPtr.cpp
242         Tests/WebKit/WKString.cpp
243         Tests/WebKit/WKStringJSString.cpp
244         Tests/WebKit/WKURL.cpp
245         Tests/WebKit/WillSendSubmitEvent.cpp
246     )
247
248     set(TestWebKit_PRIVATE_INCLUDE_DIRECTORIES
249         ${CMAKE_BINARY_DIR}
250         ${TESTWEBKITAPI_DIR}
251         ${THIRDPARTY_DIR}/gtest/include
252         ${PAL_FRAMEWORK_HEADERS_DIR}
253         ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
254         ${JavaScriptCore_FRAMEWORK_HEADERS_DIR}
255         ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}
256         ${WTF_FRAMEWORK_HEADERS_DIR}
257         ${WebKit_FRAMEWORK_HEADERS_DIR}
258     )
259
260     set(TestWebKit_LIBRARIES
261         TestWebKitAPIBase
262         WebKit
263         gtest
264     )
265
266     set(TestWebKit_DEPENDENCIES
267         NetworkProcess
268         TestWebKitAPIInjectedBundle
269         WebProcess
270     )
271
272     add_library(TestWebKitAPIBase STATIC
273         JavaScriptTest.cpp
274         PlatformUtilities.cpp
275         TestsController.cpp
276     )
277     target_compile_definitions(TestWebKitAPIBase PRIVATE BUILDING_TestWebKit)
278     target_include_directories(TestWebKitAPIBase PRIVATE ${TestWebKit_PRIVATE_INCLUDE_DIRECTORIES})
279     target_link_libraries(TestWebKitAPIBase PRIVATE WebKit gtest)
280
281     if (COMPILER_IS_GCC_OR_CLANG)
282         WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIBase -Wno-dangling-else
283                                                       -Wno-sign-compare
284                                                       -Wno-undef
285                                                       -Wno-unused-parameter)
286     endif ()
287
288     add_library(TestWebKitAPIInjectedBundle SHARED
289         InjectedBundleController.cpp
290         InjectedBundleMain.cpp
291         PlatformUtilities.cpp
292         Tests/WebKit/CanHandleRequest_Bundle.cpp
293         Tests/WebKit/DidAssociateFormControls_Bundle.cpp
294         Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp
295         Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp
296         Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp
297         Tests/WebKit/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
298         Tests/WebKit/HitTestResultNodeHandle_Bundle.cpp
299         Tests/WebKit/InjectedBundleBasic_Bundle.cpp
300         Tests/WebKit/InjectedBundleFrameHitTest_Bundle.cpp
301         Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
302         Tests/WebKit/LoadCanceledNoServerRedirectCallback_Bundle.cpp
303         Tests/WebKit/MouseMoveAfterCrash_Bundle.cpp
304         Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
305         Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
306         Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
307         Tests/WebKit/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
308         Tests/WebKit/FirstMeaningfulPaintMilestone_Bundle.cpp
309         Tests/WebKit/ParentFrame_Bundle.cpp
310         Tests/WebKit/ProvisionalURLAfterWillSendRequestCallback_Bundle.cpp
311         Tests/WebKit/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
312         Tests/WebKit/TextFieldDidBeginAndEndEditing_Bundle.cpp
313         Tests/WebKit/UserMessage_Bundle.cpp
314         Tests/WebKit/WillLoad_Bundle.cpp
315         Tests/WebKit/WillSendSubmitEvent_Bundle.cpp
316     )
317     target_compile_definitions(TestWebKitAPIInjectedBundle PRIVATE BUILDING_TestWebKit)
318     target_include_directories(TestWebKitAPIInjectedBundle PRIVATE ${TestWebKit_PRIVATE_INCLUDE_DIRECTORIES})
319     target_link_libraries(TestWebKitAPIInjectedBundle PRIVATE WebKit)
320
321     if (COMPILER_IS_GCC_OR_CLANG)
322         WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIInjectedBundle -Wno-dangling-else
323                                                                 -Wno-sign-compare
324                                                                 -Wno-undef
325                                                                 -Wno-unused-parameter)
326     endif ()
327
328     WEBKIT_EXECUTABLE_DECLARE(TestWebKit)
329 endif ()
330
331 # Include platform specific files
332 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
333
334 # TestWTF target
335 WEBKIT_TEST(TestWTF)
336
337 # TestWebCore target
338 if (ENABLE_WEBCORE)
339     WEBKIT_TEST(TestWebCore)
340 endif ()
341
342 # TestWebKitLegacy target
343 if (ENABLE_WEBKIT_LEGACY)
344     WEBKIT_TEST(TestWebKitLegacy)
345 endif ()
346
347 # TestWebKit target
348 if (ENABLE_WEBKIT)
349     WEBKIT_TEST(TestWebKit)
350 endif ()