Unreviewed, rolling out r196791.
[WebKit-https.git] / Tools / TestWebKitAPI / CMakeLists.txt
index dc2513d..4ca072c 100644 (file)
@@ -1,62 +1,37 @@
 set(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
-set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
-
-include_directories(${CMAKE_BINARY_DIR}
-    ${TESTWEBKITAPI_DIR}
-    ${CMAKE_SOURCE_DIR}/Source
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
-    ${DERIVED_SOURCES_WEBCORE_DIR}
-    ${JAVASCRIPTCORE_DIR}
-    ${JAVASCRIPTCORE_DIR}/API
-    ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
-    ${THIRDPARTY_DIR}/gtest/include
-    ${WEBCORE_DIR}/css
-    ${WEBCORE_DIR}/dom
-    ${WEBCORE_DIR}/editing
-    ${WEBCORE_DIR}/loader/cache
-    ${WEBCORE_DIR}/platform
-    ${WEBCORE_DIR}/platform/animation
-    ${WEBCORE_DIR}/platform/graphics
-    ${WEBCORE_DIR}/platform/text
-    ${WEBCORE_DIR}/platform/network
-    ${WEBCORE_DIR}/platform/network/soup
-    ${WEBCORE_DIR}/rendering/style
-    ${WEBKIT2_DIR}/Platform/IPC
-    ${WEBKIT2_DIR}/Shared
-    ${WEBKIT2_DIR}/Shared/API
-    ${WEBKIT2_DIR}/Shared/API/c
-    ${WEBKIT2_DIR}/Shared/Plugins
-    ${WEBKIT2_DIR}/UIProcess
-    ${WEBKIT2_DIR}/UIProcess/API
-    ${WEBKIT2_DIR}/WebProcess/InjectedBundle
-    ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c
-    ${WTF_DIR}
-)
-
 set(test_wtf_LIBRARIES
-    WTF
+    WTF${DEBUG_SUFFIX}
     gtest
 )
 
 set(test_webcore_LIBRARIES
-    WTF
-    WebCore
-    gtest
-)
-
-set(test_webkit2_api_LIBRARIES
-    JavaScriptCore
-    TestWebKitAPIBase
-    WTF
-    WebKit2
+    WTF${DEBUG_SUFFIX}
+    WebCore${DEBUG_SUFFIX}
     gtest
 )
 
 set(TestWebKitAPI_LIBRARIES
-    WTF
-    WebKit2
+    WTF${DEBUG_SUFFIX}
 )
 
+if (ENABLE_WEBKIT2)
+    set(test_webkit2_api_LIBRARIES
+        JavaScriptCore
+        TestWebKitAPIBase
+        WTF
+        WebKit2
+        gtest
+    )
+    list(APPEND TestWebKitAPI_LIBRARIES
+        WebKit2
+    )
+else ()
+    list(APPEND TestWebKitAPI_LIBRARIES
+        WebKit${DEBUG_SUFFIX}
+    )
+endif ()
+
+
 set(TestJavaScriptCore_LIBRARIES
     JavaScriptCore
     gtest
@@ -67,6 +42,7 @@ set(TestWTF_SOURCES
     ${TESTWEBKITAPI_DIR}/TestsController.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/AtomicString.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/CString.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WTF/Condition.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/CheckedArithmeticOperations.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/DateMath.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/Deque.cpp
@@ -81,6 +57,7 @@ set(TestWTF_SOURCES
     ${TESTWEBKITAPI_DIR}/Tests/WTF/MediaTime.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/MetaAllocator.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/NakedPtr.cpp
+    ${TESTWEBKITAPI_DIR}/Tests/WTF/ParkingLot.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/RedBlackTree.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/Ref.cpp
     ${TESTWEBKITAPI_DIR}/Tests/WTF/RefPtr.cpp
@@ -99,42 +76,83 @@ set(TestWTF_SOURCES
 
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
-add_library(TestWebKitAPIInjectedBundle SHARED
-    ${bundle_harness_SOURCES}
-    ${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
-    ${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
-    ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/TextFieldDidBeginAndEndEditing_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillLoad_Bundle.cpp
-    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
+include_directories(
+    ${TESTWEBKITAPI_DIR}
+    ${CMAKE_BINARY_DIR}
+    ${CMAKE_SOURCE_DIR}/Source
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
+    ${DERIVED_SOURCES_WEBCORE_DIR}
+    ${JAVASCRIPTCORE_DIR}
+    ${JAVASCRIPTCORE_DIR}/API
+    ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
+    ${THIRDPARTY_DIR}/gtest/include
+    ${WEBCORE_DIR}/css
+    ${WEBCORE_DIR}/dom
+    ${WEBCORE_DIR}/editing
+    ${WEBCORE_DIR}/loader/cache
+    ${WEBCORE_DIR}/platform
+    ${WEBCORE_DIR}/platform/animation
+    ${WEBCORE_DIR}/platform/graphics
+    ${WEBCORE_DIR}/platform/text
+    ${WEBCORE_DIR}/platform/network
+    ${WEBCORE_DIR}/platform/network/soup
+    ${WEBCORE_DIR}/rendering/style
+    ${WEBKIT2_DIR}/Platform/IPC
+    ${WEBKIT2_DIR}/Shared
+    ${WEBKIT2_DIR}/Shared/API
+    ${WEBKIT2_DIR}/Shared/API/c
+    ${WEBKIT2_DIR}/Shared/Plugins
+    ${WEBKIT2_DIR}/UIProcess
+    ${WEBKIT2_DIR}/UIProcess/API
+    ${WEBKIT2_DIR}/WebProcess/InjectedBundle
+    ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c
+    ${WTF_DIR}
 )
 
-target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
-add_dependencies(TestWebKitAPIInjectedBundle ${ForwardingHeadersForTestWebKitAPI_NAME})
+if (ENABLE_WEBKIT2)
+    add_library(TestWebKitAPIInjectedBundle SHARED
+        ${bundle_harness_SOURCES}
+        ${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
+        ${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
+        ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/TextFieldDidBeginAndEndEditing_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillLoad_Bundle.cpp
+        ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
+    )
 
-get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
+    target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
+    add_dependencies(TestWebKitAPIInjectedBundle WTF ${ForwardingHeadersForTestWebKitAPI_NAME})
 
-add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DGTEST_HAS_RTTI=0
+    get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
+endif ()
+
+if (WIN32)
+    add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=0)
+else ()
+    add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
+endif ()
+
+add_definitions(-DGTEST_HAS_RTTI=0
     -DTEST_WEBKIT2_RESOURCES_DIR=\"${TESTWEBKITAPI_DIR}/Tests/WebKit2\"
     -DTEST_INJECTED_BUNDLE_PATH=\"${TestWebKitAPIInjectedBundle_PATH}\"
 )
@@ -150,28 +168,19 @@ add_executable(TestWTF
     ${TestWTF_SOURCES}
 )
 
+if (WIN32)
+    add_dependencies(TestWTF TestWTFLib)
+endif ()
+
 target_link_libraries(TestWTF ${test_wtf_LIBRARIES})
-add_dependencies(TestWTF ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-add_test(TestWTF ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF/TestWTF)
+add_dependencies(TestWTF WTF ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+add_test(TestWTF ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF}/TestWTF)
 set_tests_properties(TestWTF PROPERTIES TIMEOUT 60)
-    set_target_properties(TestWTF PROPERTIES
-        RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF
-    )
-
-
-add_executable(TestJavaScriptCore
-    ${test_main_SOURCES}
-    ${TESTWEBKITAPI_DIR}/TestsController.cpp
+set_target_properties(TestWTF PROPERTIES
+    RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF}
 )
 
-target_link_libraries(TestJavaScriptCore ${TestJavaScriptCore_LIBRARIES})
-add_dependencies(TestJavaScriptCore ${ForwardingHeadersForTestWebKitAPI_NAME})
-
-add_test(TestJavaScriptCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore/TestJavaScriptCore)
-set_tests_properties(TestJavaScriptCore PROPERTIES TIMEOUT 60)
-set_target_properties(TestJavaScriptCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
-add_dependencies(TestJavaScriptCore JavaScriptCore ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-
+# FIXME: EFL is the only port that separates the WebCore binaries. Each port ought to do closer to the same thing.
 foreach (testName ${test_webcore_BINARIES})
     add_executable(${testName} ${test_main_SOURCES} ${TESTWEBKITAPI_DIR}/TestsController.cpp ${TESTWEBKITAPI_DIR}/Tests/WebCore/${testName}.cpp)
     add_test(${testName} ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/${testName})
@@ -182,34 +191,36 @@ foreach (testName ${test_webcore_BINARIES})
     )
 endforeach ()
 
-add_library(TestWebKitAPIBase
-    ${test_main_SOURCES}
-    ${webkit2_api_harness_SOURCES}
-    ${TESTWEBKITAPI_DIR}/JavaScriptTest.cpp
-    ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
-    ${TESTWEBKITAPI_DIR}/TestsController.cpp
-)
-
-add_dependencies(TestWebKitAPIBase WebKit2 ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-
-foreach (testName ${test_webkit2_api_BINARIES})
-    get_filename_component(testBaseName ${testName} NAME)
-    add_executable(${testBaseName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
-    add_test(${testBaseName} ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/${testBaseName})
-    set_tests_properties(${testBaseName} PROPERTIES TIMEOUT 60)
-    target_link_libraries(${testBaseName} ${test_webkit2_api_LIBRARIES})
-    set_target_properties(${testBaseName} PROPERTIES
-        RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2
+if (ENABLE_WEBKIT2)
+    add_library(TestWebKitAPIBase
+        ${test_main_SOURCES}
+        ${webkit2_api_harness_SOURCES}
+        ${TESTWEBKITAPI_DIR}/JavaScriptTest.cpp
+        ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
+        ${TESTWEBKITAPI_DIR}/TestsController.cpp
     )
-endforeach ()
 
-# We don't run tests that are expected to fail. We could use the WILL_FAIL
-# property, but it reports failure when the test crashes or timeouts and would
-# make the bot red.
-foreach (testName ${test_webkit2_api_fail_BINARIES})
-    add_executable(${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
-    target_link_libraries(${testName} ${test_webkit2_api_LIBRARIES})
-    set_target_properties(${testName} PROPERTIES
-        RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/failure
-    )
-endforeach ()
+    add_dependencies(TestWebKitAPIBase WebKit2 ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+
+    foreach (testName ${test_webkit2_api_BINARIES})
+        get_filename_component(testBaseName ${testName} NAME)
+        add_executable(${testBaseName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+        add_test(${testBaseName} ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/${testBaseName})
+        set_tests_properties(${testBaseName} PROPERTIES TIMEOUT 60)
+        target_link_libraries(${testBaseName} ${test_webkit2_api_LIBRARIES})
+        set_target_properties(${testBaseName} PROPERTIES
+            RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2
+        )
+    endforeach ()
+
+    # We don't run tests that are expected to fail. We could use the WILL_FAIL
+    # property, but it reports failure when the test crashes or timeouts and would
+    # make the bot red.
+    foreach (testName ${test_webkit2_api_fail_BINARIES})
+        add_executable(${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+        target_link_libraries(${testName} ${test_webkit2_api_LIBRARIES})
+        set_target_properties(${testName} PROPERTIES
+            RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/failure
+        )
+    endforeach ()
+endif ()