on xenial help sign in
Some people are never happy with naming
c78b47fAlbert Astals
tests/plugins/DashViews/CMakeLists.txt+10−15
@@ -40,12 +40,7 @@ qt5_use_modules(listviewwithpageheadertestsectionexternalmodelExec Test Core Qml
40target_link_libraries(listviewwithpageheadertestsectionexternalmodelExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
40target_link_libraries(listviewwithpageheadertestsectionexternalmodelExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
41add_custom_target(testlistviewwithpageheadersectionexternalmodel ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionexternalmodelExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersectionexternalmodel.xml,xunitxml -o -,txt)
41add_custom_target(testlistviewwithpageheadersectionexternalmodel ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionexternalmodelExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersectionexternalmodel.xml,xunitxml -o -,txt)
42
42
43−macro(add_dashview_try_test FILENAME)
43+macro(add_dashview_try_test FILENAME TESTNAME)
44− # Capitalite the first letter for the test/try name targets
45− string(SUBSTRING ${FILENAME} 0 1 FIRST_LETTER)
46− string(TOUPPER ${FIRST_LETTER} FIRST_LETTER)
47− string(REGEX REPLACE "^.(.*)" "${FIRST_LETTER}\\1" CUSTOM_TARGET_NAME "${FILENAME}")
48−
49 add_executable(${FILENAME}testExec
44 add_executable(${FILENAME}testExec
50 ${FILENAME}test.cpp
45 ${FILENAME}test.cpp
51 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
46 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
@@ -53,9 +48,9 @@ macro(add_dashview_try_test FILENAME)
53 )
48 )
54 qt5_use_modules(${FILENAME}testExec Test Core Qml)
49 qt5_use_modules(${FILENAME}testExec Test Core Qml)
55 target_link_libraries(${FILENAME}testExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
50 target_link_libraries(${FILENAME}testExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
56− add_custom_target(test${CUSTOM_TARGET_NAME}
51+ add_custom_target(test${TESTNAME}
57 ${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}testExec
52 ${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}testExec
58− -o ${CMAKE_BINARY_DIR}/test${CUSTOM_TARGET_NAME}.xml,xunitxml
53+ -o ${CMAKE_BINARY_DIR}/test${TESTNAME}.xml,xunitxml
59 -o -,txt
54 -o -,txt
60 DEPENDS ${FILENAME}testExec DashViews-qml
55 DEPENDS ${FILENAME}testExec DashViews-qml
61 )
56 )
@@ -67,15 +62,15 @@ macro(add_dashview_try_test FILENAME)
67 )
62 )
68 qt5_use_modules(${FILENAME}tryExec Test Core Qml)
63 qt5_use_modules(${FILENAME}tryExec Test Core Qml)
69 target_link_libraries(${FILENAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
64 target_link_libraries(${FILENAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
70− add_custom_target(try${CUSTOM_TARGET_NAME}
65+ add_custom_target(try${TESTNAME}
71 ${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}tryExec
66 ${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}tryExec
72 DEPENDS ${FILENAME}tryExec DashViews-qml
67 DEPENDS ${FILENAME}tryExec DashViews-qml
73 )
68 )
74endmacro()
69endmacro()
75
70
76−add_dashview_try_test(verticaljournal)
71+add_dashview_try_test(verticaljournal VerticalJournal)
77−add_dashview_try_test(horizontaljournal)
72+add_dashview_try_test(horizontaljournal HorizontalJournal)
78−add_dashview_try_test(organicgrid)
73+add_dashview_try_test(organicgrid OrganicGrid)
79
74
80set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
75set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
81add_qml_test(. listviewwithpageheaderqml IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
76add_qml_test(. listviewwithpageheaderqml IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
@@ -84,6 +79,6 @@ add_dependencies(qmluitests testlistviewwithpageheader)
84add_dependencies(qmluitests testlistviewwithpageheadersection)
79add_dependencies(qmluitests testlistviewwithpageheadersection)
85add_dependencies(qmluitests testlistviewwithpageheadersectionexternalmodel)
80add_dependencies(qmluitests testlistviewwithpageheadersectionexternalmodel)
86add_dependencies(qmluitests testlistviewwithpageheaderqml)
81add_dependencies(qmluitests testlistviewwithpageheaderqml)
87−add_dependencies(qmluitests testVerticaljournal)
82+add_dependencies(qmluitests testVerticalJournal)
88−add_dependencies(qmluitests testHorizontaljournal)
83+add_dependencies(qmluitests testHorizontalJournal)
89−add_dependencies(qmluitests testOrganicgrid)
84+add_dependencies(qmluitests testOrganicGrid)