summaryrefslogtreecommitdiff
path: root/Source/WebKit/qt/tests/CMakeLists.txt
blob: 2691196b344bf6ac84af73de2320c1cc1f408839 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
remove_definitions(-DQT_ASCII_CAST_WARNINGS)

include_directories(
    "${CMAKE_SOURCE_DIR}/Source"
    "${DERIVED_SOURCES_DIR}/ForwardingHeaders"
    "${WEBKIT_DIR}/qt/Api"
    "${WEBKIT_DIR}/qt/WidgetApi"
)

include_directories(SYSTEM
    ${ICU_INCLUDE_DIRS}
    ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
    ${Qt5Widgets_INCLUDE_DIRS}
    ${Qt5Test_INCLUDE_DIRS}
)

if (ENABLE_TEST_SUPPORT)
    add_definitions(-DHAVE_QTTESTSUPPORT)
endif ()

set(QtWK1ApiTests_LIBRARIES
    ${Qt5Gui_LIBRARIES}
    ${Qt5Network_LIBRARIES}
    ${Qt5Test_LIBRARIES}
    ${Qt5Widgets_LIBRARIES}
    WebKitWidgets
)

# Inspired by EFL WK2 tests
set(QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY
    ${CMAKE_BINARY_DIR}/tests
)

set(QtWK1ApiTests
    hybridPixmap
    qgraphicswebview
    qobjectbridge
    qwebelement
    qwebframe
    qwebhistory
    qwebhistoryinterface
    qwebinspector
    qwebpage
    qwebsecurityorigin
    qwebview
)

set(tst_hybridPixmap_SOURCES hybridPixmap/widget.cpp)
qt5_wrap_ui(tst_hybridPixmap_SOURCES hybridPixmap/widget.ui)

if (ENABLE_API_TESTS)
    foreach (testName ${QtWK1ApiTests})
        list(APPEND tst_${testName}_SOURCES ${testName}/tst_${testName}.cpp)
        if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${testName}/tst_${testName}.qrc")
            qt5_add_resources(tst_${testName}_SOURCES ${testName}/tst_${testName}.qrc)
        endif ()

        add_executable(tst_${testName} ${tst_${testName}_SOURCES})
        target_include_directories(tst_${testName} PRIVATE ${testName})
        target_link_libraries(tst_${testName} ${QtWK1ApiTests_LIBRARIES})
        set_target_properties(tst_${testName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY})

        add_test(${testName} "${QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY}/tst_${testName}")
        set_tests_properties(${testName} PROPERTIES TIMEOUT 60)
    endforeach ()
endif ()