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