on bbbdccd help sign in
unity8/tests/plugins/Dash/CMakeLists.txt
75 lines 3.0 kB history raw
1# add_qml_test macro
2include(QmlTest)
4# There's no cmake var for v8 include path :-/
5# so create one
6LIST(GET Qt5Core_INCLUDE_DIRS 0 QtCoreDir0)
7if(${Qt5Core_VERSION_STRING} VERSION_LESS "5.1.0")
8 SET(Qt5V8_PRIVATE_INCLUDE_DIR ${QtCoreDir0}/../QtV8/${Qt5Core_VERSION_STRING}/QtV8)
9else()
10 SET(Qt5V8_PRIVATE_INCLUDE_DIR ${QtCoreDir0}/QtV8/${Qt5Core_VERSION_STRING}/QtV8)
11endif()
14include_directories(
15 ${Qt5Qml_PRIVATE_INCLUDE_DIRS}
16 ${Qt5Quick_INCLUDE_DIRS}
17 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
18 ${Qt5V8_PRIVATE_INCLUDE_DIR}
19 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash
20 ${CMAKE_CURRENT_BINARY_DIR}
21 )
23remove_definitions(-DQT_NO_KEYWORDS)
25add_definitions(-DDASHVIEWSTEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
27macro(add_lvwph_test FILENAME TESTNAME)
28 add_executable(${TESTNAME}TestExec
29 ${FILENAME}test.cpp
30 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/listviewwithpageheader.cpp)
31 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
32 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
34 add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
35endmacro()
37add_lvwph_test(listviewwithpageheader ListViewWithPageHeader)
38add_lvwph_test(listviewwithpageheadersection ListViewWithPageHeaderSection)
39add_lvwph_test(listviewwithpageheadersectionexternalmodel ListViewWithPageHeaderSectionExternalModel)
41macro(add_dashview_try_test FILENAME TESTNAME)
42 add_executable(${TESTNAME}TestExec
43 ${FILENAME}test.cpp
44 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
45 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
46 )
47 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
48 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
50 add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
52 add_executable(${TESTNAME}TryExec
53 ${FILENAME}try.cpp
54 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
55 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
56 )
57 qt5_use_modules(${TESTNAME}TryExec Test Core Qml)
58 target_link_libraries(${TESTNAME}TryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
59 add_manual_test(${TESTNAME} ${TESTNAME}TryExec DEPENDS Dash-qml)
60endmacro()
62add_dashview_try_test(verticaljournal VerticalJournal)
63add_dashview_try_test(horizontaljournal HorizontalJournal)
64add_dashview_try_test(organicgrid OrganicGrid)
66# CardCreator test
67add_executable(CardCreatorTestExec cardcreatortest.cpp)
68qt5_use_modules(CardCreatorTestExec Test Core Qml)
69target_link_libraries(CardCreatorTestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
70add_unity8_uitest(CardCreator CardCreatorTestExec DEPENDS Dash-qml)
72# plain qml test
73foreach(dash_test ScopeStyle ListViewWithPageHeaderQML CardAttributes CroppedImageMinimumSourceSize)
74 add_unity8_qmltest(. ${dash_test})
75endforeach()