Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main...
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformWPE.cmake
1 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI")
2 set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY_WTF "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WTF")
3
4 # This is necessary because it is possible to build TestWebKitAPI with WebKit2
5 # disabled and this triggers the inclusion of the WebKit2 headers.
6 add_definitions(-DBUILDING_WEBKIT2__)
7
8 add_custom_target(TestWebKitAPI-forwarding-headers
9     COMMAND ${PERL_EXECUTABLE} ${WEBKIT_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform wpe --platform soup
10     DEPENDS webkitwpe-forwarding-headers
11 )
12
13 set(ForwardingHeadersForTestWebKitAPI_NAME TestWebKitAPI-forwarding-headers)
14
15 include_directories(
16     ${FORWARDING_HEADERS_DIR}
17     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
18     ${FORWARDING_HEADERS_DIR}/JavaScriptCore/glib
19     ${DERIVED_SOURCES_JAVASCRIPCOREWPE_DIR}
20     ${TOOLS_DIR}/wpe/HeadlessViewBackend
21 )
22
23 include_directories(SYSTEM
24     ${CAIRO_INCLUDE_DIRS}
25     ${GLIB_INCLUDE_DIRS}
26     ${LIBSOUP_INCLUDE_DIRS}
27 )
28
29 set(test_main_SOURCES
30     ${TESTWEBKITAPI_DIR}/wpe/main.cpp
31 )
32
33 set(bundle_harness_SOURCES
34     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
35     ${TESTWEBKITAPI_DIR}/wpe/InjectedBundleControllerWPE.cpp
36     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
37 )
38
39 set(webkit_api_harness_SOURCES
40     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
41     ${TESTWEBKITAPI_DIR}/wpe/PlatformUtilitiesWPE.cpp
42     ${TESTWEBKITAPI_DIR}/wpe/PlatformWebViewWPE.cpp
43 )
44
45 # TestWTF
46
47 list(APPEND TestWTF_SOURCES
48     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
49     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
50     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
51 )
52
53 # TestWebCore
54
55 add_executable(TestWebCore
56     ${test_main_SOURCES}
57     ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp
58     ${TESTWEBKITAPI_DIR}/TestsController.cpp
59     ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
60     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
61     ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp
62     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
63     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
64     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBufferTest.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileMonitor.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
68 )
69
70 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
71 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
72
73 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
74 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
75 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
76
77 # TestWebKit
78
79 list(APPEND test_webkit_api_LIBRARIES
80     WPEHeadlessViewBackend
81 )
82
83 add_executable(TestWebKit ${test_webkit_api_SOURCES})
84
85 target_link_libraries(TestWebKit ${test_webkit_api_LIBRARIES})
86 add_test(TestWebKit ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit/TestWebKit)
87 set_tests_properties(TestWebKit PROPERTIES TIMEOUT 60)
88 set_target_properties(TestWebKit PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit)
89
90 add_executable(TestJSC ${TESTWEBKITAPI_DIR}/Tests/JavaScriptCore/glib/TestJSC.cpp)
91 target_link_libraries(TestJSC
92     ${GLIB_LIBRARIES}
93     JavaScriptCore
94 )
95 add_test(TestJSC ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore/TestJSC)
96 set_tests_properties(TestJSC PROPERTIES TIMEOUT 60)
97 set_target_properties(TestJSC PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/JavaScriptCore)
98
99 if (COMPILER_IS_GCC_OR_CLANG)
100     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebCore -Wno-sign-compare
101                                             -Wno-undef
102                                             -Wno-unused-parameter)
103     WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKit -Wno-sign-compare
104                                            -Wno-undef
105                                            -Wno-unused-parameter)
106     WEBKIT_ADD_TARGET_CXX_FLAGS(TestJSC -Wno-sign-compare
107                                         -Wno-undef
108                                         -Wno-unused-parameter)
109 endif ()