Unreviewed Efl build fix after r148921
[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}/Shared/Plugins
20     ${WEBKIT2_DIR}/UIProcess
21     ${WTF_DIR}
22 )
23
24 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
25
26 add_library(TestWebKitAPIInjectedBundle SHARED
27     ${bundle_harness_SOURCES}
28     ${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
29     ${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
30     ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
31     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
32     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
33     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
34     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
35     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
36     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
37     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
38     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
39     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
40     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
41     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
42     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
43     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
44     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
45     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
46     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
47     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
48     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
50     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKConnection_Bundle.cpp
51     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
52 )
53
54 target_link_libraries(TestWebKitAPIInjectedBundle ${WTF_LIBRARY_NAME})
55 add_dependencies(TestWebKitAPIInjectedBundle ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
56
57 get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
58
59 add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1
60     -DTEST_WEBKIT2_RESOURCES_DIR=\"${TESTWEBKITAPI_DIR}/Tests/WebKit2\"
61     -DTEST_INJECTED_BUNDLE_PATH=\"${TestWebKitAPIInjectedBundle_PATH}\"
62 )
63
64 set(test_wtf_LIBRARIES
65     ${WTF_LIBRARY_NAME}
66     gtest
67 )
68
69 add_executable(test_wtf
70     ${test_main_SOURCES}
71     ${TESTWEBKITAPI_DIR}/TestsController.cpp
72     ${TESTWEBKITAPI_DIR}/Tests/WTF/AtomicString.cpp
73     ${TESTWEBKITAPI_DIR}/Tests/WTF/CString.cpp
74     ${TESTWEBKITAPI_DIR}/Tests/WTF/CheckedArithmeticOperations.cpp
75     ${TESTWEBKITAPI_DIR}/Tests/WTF/Functional.cpp
76     ${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp
77     ${TESTWEBKITAPI_DIR}/Tests/WTF/IntegerToStringConversion.cpp
78     ${TESTWEBKITAPI_DIR}/Tests/WTF/ListHashSet.cpp
79     ${TESTWEBKITAPI_DIR}/Tests/WTF/MathExtras.cpp
80     ${TESTWEBKITAPI_DIR}/Tests/WTF/MetaAllocator.cpp
81     ${TESTWEBKITAPI_DIR}/Tests/WTF/RedBlackTree.cpp
82     ${TESTWEBKITAPI_DIR}/Tests/WTF/SaturatedArithmeticOperations.cpp
83     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringBuilder.cpp
84     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringHasher.cpp
85     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringImpl.cpp
86     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringOperators.cpp
87     ${TESTWEBKITAPI_DIR}/Tests/WTF/TemporaryChange.cpp
88     ${TESTWEBKITAPI_DIR}/Tests/WTF/Vector.cpp
89     ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorBasic.cpp
90     ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorReverse.cpp
91     ${TESTWEBKITAPI_DIR}/Tests/WTF/WTFString.cpp
92 )
93
94 target_link_libraries(test_wtf ${test_wtf_LIBRARIES})
95 add_dependencies(test_wtf ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
96 add_test(test_wtf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_wtf)
97 set_tests_properties(test_wtf PROPERTIES TIMEOUT 60)
98
99 set(test_webcore_LIBRARIES
100     gtest
101     ${WTF_LIBRARY_NAME}
102     ${WebCore_LIBRARY_NAME}
103 )
104
105 foreach (testName ${test_webcore_BINARIES})
106     add_executable(test_webcore_${testName} ${test_main_SOURCES} ${TESTWEBKITAPI_DIR}/TestsController.cpp ${TESTWEBKITAPI_DIR}/Tests/WebCore/${testName}.cpp)
107     add_test(test_webcore_${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webcore_${testName})
108     set_tests_properties(test_webcore_${testName} PROPERTIES TIMEOUT 60)
109     target_link_libraries(test_webcore_${testName} ${test_webcore_LIBRARIES})
110 endforeach ()
111
112 add_library(TestWebKitAPIBase
113     ${test_main_SOURCES}
114     ${webkit2_api_harness_SOURCES}
115     ${TESTWEBKITAPI_DIR}/JavaScriptTest.cpp
116     ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
117     ${TESTWEBKITAPI_DIR}/TestsController.cpp
118 )
119
120 add_dependencies(TestWebKitAPIBase ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
121
122 set(test_webkit2_api_LIBRARIES
123     TestWebKitAPIBase
124     ${WTF_LIBRARY_NAME}
125     ${JavaScriptCore_LIBRARY_NAME}
126     ${WebKit2_LIBRARY_NAME}
127     gtest
128 )
129
130 foreach (testName ${test_webkit2_api_BINARIES})
131     get_filename_component(testBaseName ${testName} NAME)
132     add_executable(test_webkit2_api_${testBaseName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
133     add_test(test_webkit2_api_${testBaseName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webkit2_api_${testBaseName})
134     set_tests_properties(test_webkit2_api_${testBaseName} PROPERTIES TIMEOUT 60)
135     target_link_libraries(test_webkit2_api_${testBaseName} ${test_webkit2_api_LIBRARIES})
136 endforeach ()
137
138 # We don't run tests that are expected to fail. We could use the WILL_FAIL
139 # property, but it reports failure when the test crashes or timeouts and would
140 # make the bot red.
141
142 foreach (testName ${test_webkit2_api_fail_BINARIES})
143     add_executable(test_webkit2_api_fail_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
144     target_link_libraries(test_webkit2_api_fail_${testName} ${test_webkit2_api_LIBRARIES})
145 endforeach ()