Clamp values in LayoutUnit::operator/ when SATURATED_LAYOUT_ARITHMETIC is enabled
[WebKit-https.git] / Tools / TestWebKitAPI / CMakeLists.txt
1 set(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
2
3 include_directories(${CMAKE_BINARY_DIR}
4     ${TESTWEBKITAPI_DIR}
5     ${CMAKE_SOURCE_DIR}/Source
6     ${DERIVED_SOURCES_WEBCORE_DIR}
7     ${DERIVED_SOURCES_WEBKIT2_DIR}/include
8     ${JAVASCRIPTCORE_DIR}
9     ${JAVASCRIPTCORE_DIR}/API
10     ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
11     ${THIRDPARTY_DIR}/gtest/include
12     ${WEBCORE_DIR}/editing
13     ${WEBCORE_DIR}/platform
14     ${WEBCORE_DIR}/platform/graphics
15     ${WEBCORE_DIR}/platform/text
16     ${WEBCORE_DIR}/platform/network
17     ${WEBKIT2_DIR}/Shared
18     ${WEBKIT2_DIR}/Shared/API/c
19     ${WEBKIT2_DIR}/UIProcess
20     ${WTF_DIR}
21 )
22
23 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
24
25 add_library(TestWebKitAPIInjectedBundle SHARED
26     ${bundle_harness_SOURCES}
27     ${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
28     ${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
29     ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
30     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
31     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
32     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
33     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
34     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
35     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
36     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
37     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
38     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
39     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
40     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
41     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
42     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
43     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
44     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
45     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
46     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
47     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
48     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKConnection_Bundle.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
50 )
51
52 target_link_libraries(TestWebKitAPIInjectedBundle ${WTF_LIBRARY_NAME})
53 add_dependencies(TestWebKitAPIInjectedBundle ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
54
55 get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
56
57 add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1
58     -DTEST_WEBKIT2_RESOURCES_DIR=\"${TESTWEBKITAPI_DIR}/Tests/WebKit2\"
59     -DTEST_INJECTED_BUNDLE_PATH=\"${TestWebKitAPIInjectedBundle_PATH}\"
60 )
61
62 set(test_wtf_LIBRARIES
63     ${WTF_LIBRARY_NAME}
64     gtest
65 )
66
67 add_executable(test_wtf
68     ${test_main_SOURCES}
69     ${TESTWEBKITAPI_DIR}/TestsController.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WTF/AtomicString.cpp
71     ${TESTWEBKITAPI_DIR}/Tests/WTF/CString.cpp
72     ${TESTWEBKITAPI_DIR}/Tests/WTF/CheckedArithmeticOperations.cpp
73     ${TESTWEBKITAPI_DIR}/Tests/WTF/Functional.cpp
74     ${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp
75     ${TESTWEBKITAPI_DIR}/Tests/WTF/IntegerToStringConversion.cpp
76     ${TESTWEBKITAPI_DIR}/Tests/WTF/ListHashSet.cpp
77     ${TESTWEBKITAPI_DIR}/Tests/WTF/MathExtras.cpp
78     ${TESTWEBKITAPI_DIR}/Tests/WTF/MetaAllocator.cpp
79     ${TESTWEBKITAPI_DIR}/Tests/WTF/MemoryInstrumentationTest.cpp
80     ${TESTWEBKITAPI_DIR}/Tests/WTF/RedBlackTree.cpp
81     ${TESTWEBKITAPI_DIR}/Tests/WTF/SaturatedArithmeticOperations.cpp
82     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringBuilder.cpp
83     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringImpl.cpp
84     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringOperators.cpp
85     ${TESTWEBKITAPI_DIR}/Tests/WTF/TemporaryChange.cpp
86     ${TESTWEBKITAPI_DIR}/Tests/WTF/Vector.cpp
87     ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorBasic.cpp
88     ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorReverse.cpp
89     ${TESTWEBKITAPI_DIR}/Tests/WTF/WTFString.cpp
90 )
91
92 target_link_libraries(test_wtf ${test_wtf_LIBRARIES})
93 add_dependencies(test_wtf ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
94 add_test(test_wtf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_wtf)
95 set_tests_properties(test_wtf PROPERTIES TIMEOUT 60)
96
97 set(test_webcore_LIBRARIES
98     gtest
99     ${WTF_LIBRARY_NAME}
100     ${WebCore_LIBRARY_NAME}
101 )
102
103 add_executable(test_webcore
104     ${test_main_SOURCES}
105     ${TESTWEBKITAPI_DIR}/TestsController.cpp
106     ${TESTWEBKITAPI_DIR}/Tests/WebCore/KURL.cpp
107     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
108 )
109
110 target_link_libraries(test_webcore ${test_webcore_LIBRARIES})
111 add_dependencies(test_webcore ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
112 add_test(test_webcore ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webcore)
113 set_tests_properties(test_webcore PROPERTIES TIMEOUT 60)
114
115 add_library(TestWebKitAPIBase
116     ${test_main_SOURCES}
117     ${webkit2_api_harness_SOURCES}
118     ${TESTWEBKITAPI_DIR}/JavaScriptTest.cpp
119     ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
120     ${TESTWEBKITAPI_DIR}/TestsController.cpp
121 )
122
123 add_dependencies(TestWebKitAPIBase ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
124
125 set(test_webkit2_api_LIBRARIES
126     TestWebKitAPIBase
127     ${WTF_LIBRARY_NAME}
128     ${JavaScriptCore_LIBRARY_NAME}
129     ${WebKit2_LIBRARY_NAME}
130     gtest
131 )
132
133 foreach (testName ${test_webkit2_api_BINARIES})
134     add_executable(test_webkit2_api_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
135     add_test(test_webkit2_api_${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webkit2_api_${testName})
136     set_tests_properties(test_webkit2_api_${testName} PROPERTIES TIMEOUT 60)
137     target_link_libraries(test_webkit2_api_${testName} ${test_webkit2_api_LIBRARIES})
138 endforeach ()
139
140 # We don't run tests that are expected to fail. We could use the WILL_FAIL
141 # property, but it reports failure when the test crashes or timeouts and would
142 # make the bot red.
143
144 foreach (testName ${test_webkit2_api_fail_BINARIES})
145     add_executable(test_webkit2_api_fail_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
146     target_link_libraries(test_webkit2_api_fail_${testName} ${test_webkit2_api_LIBRARIES})
147 endforeach ()