on xenial help sign in
Transition to unity8 test functions and unify test naming to CamelCase
commitafa7145c79d726862b01048fd6bec89baac1a899 authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 30 Apr 2015, 00:05 (11 years ago) parent88119dd
26 files changed+94−126
tests/copyright/CMakeLists.txt+1−1 tests/libs/UbuntuGestures/CMakeLists.txt+4−8 tests/plugins/AccountsService/CMakeLists.txt+5−4 tests/plugins/Dash/CMakeLists.txt+10−17 tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+4−5 tests/plugins/LightDM/CMakeLists.txt+9−3 tests/plugins/Ubuntu/Gestures/CMakeLists.txt+14−24 tests/plugins/Unity/Indicators/CMakeLists.txt+9−12 tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp → tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpp+1−1 tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp → tests/plugins/Unity/Indicators/IndicatorsModelTest.cpp+1−1 tests/plugins/Unity/Indicators/menucontentactivatortest.cpp → tests/plugins/Unity/Indicators/MenuContentActivatorTest.cpp+1−1 tests/plugins/Unity/Indicators/rootactionstatetest.cpp → tests/plugins/Unity/Indicators/RootActionStateTest.cpp+1−1 tests/plugins/Unity/Indicators/sharedunitymenumodeltest.cpp → tests/plugins/Unity/Indicators/SharedUnityMenuModelTest.cpp+1−1 tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp → tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp+1−1 tests/plugins/Unity/Launcher/CMakeLists.txt+5−5 tests/plugins/Unity/Session/CMakeLists.txt+5−5 tests/plugins/Utils/CMakeLists.txt+12−26 tests/plugins/Utils/homekeywatchertest.cpp → tests/plugins/Utils/HomeKeyWatcherTest.cpp+1−1 tests/plugins/Utils/modeltest.cpp → tests/plugins/Utils/ModelTest.cpp+1−1 tests/plugins/Utils/modeltest.h → tests/plugins/Utils/ModelTest.h tests/plugins/Utils/qlimitproxymodeltest.cpp → tests/plugins/Utils/QLimitProxyModelTest.cpp+2−2 tests/plugins/Utils/timeformattertest.cpp → tests/plugins/Utils/TimeFormatterTest.cpp+1−1 tests/plugins/Utils/unitysortfilterproxymodeltest.cpp → tests/plugins/Utils/UnitySortFilterProxyModelTest.cpp+2−2 tests/plugins/Wizard/CMakeLists.txt+1−1 tests/qmltests/Components/CMakeLists.txt+1−1 tests/whitespace/CMakeLists.txt+1−1
tests/copyright/CMakeLists.txt+1−1
@@ -2,5 +2,5 @@
22# Test that all source files contain a copyright header.
33#
44
5−add_test(copyright ${CMAKE_CURRENT_SOURCE_DIR}/check_copyright.sh
5+add_test(Copyright ${CMAKE_CURRENT_SOURCE_DIR}/check_copyright.sh
66 ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
tests/libs/UbuntuGestures/CMakeLists.txt+4−8
@@ -4,17 +4,13 @@ include_directories(
44 )
55
66macro(add_gesture_test CLASSNAME)
7− set(testCommand
8− ${CLASSNAME}TestExec -o ${CMAKE_BINARY_DIR}/test${CLASSNAME}.xml,xunitxml -o -,txt)
9−
10− add_test(NAME test${CLASSNAME} COMMAND ${testCommand})
11−
12− set_tests_properties(test${CLASSNAME} PROPERTIES
13− ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures)
14−
157 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
168 qt5_use_modules(${CLASSNAME}TestExec Test Core Gui Quick)
179 target_link_libraries(${CLASSNAME}TestExec UbuntuGestures)
10+
11+ add_unity8_unittest(${CLASSNAME} ${CLASSNAME}TestExec
12+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/libs/UbuntuGestures
13+ )
1814endmacro(add_gesture_test)
1915
2016add_gesture_test(TouchRegistry)
tests/plugins/AccountsService/CMakeLists.txt+5−4
@@ -43,12 +43,13 @@ add_executable(test-accountsservice
4343 )
4444qt5_use_modules(test-accountsservice Core DBus Test)
4545
46−add_test(NAME test-accountsservice
47− COMMAND dbus-test-runner
48− --task ${CMAKE_CURRENT_BINARY_DIR}/mock-server
46+add_unity8_unittest(AccountsService dbus-test-runner
47+ ARG_PREFIX "--parameter"
48+ ARGS
49+ --task $<TARGET_FILE:mock-server>
4950 --task-name server
5051 --ignore-return
51− --task ${CMAKE_CURRENT_BINARY_DIR}/test-accountsservice
52+ --task $<TARGET_FILE:test-accountsservice>
5253 --task-name client
5354 --wait-for org.freedesktop.Accounts
5455 )
tests/plugins/Dash/CMakeLists.txt+10−17
@@ -32,7 +32,7 @@ macro(add_lvwph_test FILENAME TESTNAME)
3232 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
3333 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
3434
35− add_binary_qml_test(${TESTNAME} "" "Dash-qml" "")
35+ add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
3636endmacro()
3737
3838add_lvwph_test(listviewwithpageheader ListViewWithPageHeader)
@@ -48,19 +48,16 @@ macro(add_dashview_try_test FILENAME TESTNAME)
4848 qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
4949 target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
5050
51− add_binary_qml_test(${TESTNAME} "" "Dash-qml" "")
51+ add_unity8_uitest(${TESTNAME} ${TESTNAME}TestExec DEPENDS Dash-qml)
5252
53− add_executable(${TESTNAME}tryExec
53+ add_executable(${TESTNAME}TryExec
5454 ${FILENAME}try.cpp
5555 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/${FILENAME}.cpp
5656 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/Dash/abstractdashview.cpp
5757 )
58− qt5_use_modules(${TESTNAME}tryExec Test Core Qml)
59− target_link_libraries(${TESTNAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
60− add_custom_target(try${TESTNAME}
61− ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}tryExec
62− DEPENDS ${TESTNAME}tryExec Dash-qml
63− )
58+ qt5_use_modules(${TESTNAME}TryExec Test Core Qml)
59+ target_link_libraries(${TESTNAME}TryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
60+ add_manual_test(${TESTNAME} ${TESTNAME}TryExec DEPENDS Dash-qml)
6461endmacro()
6562
6663add_dashview_try_test(verticaljournal VerticalJournal)
@@ -71,13 +68,9 @@ add_dashview_try_test(organicgrid OrganicGrid)
7168add_executable(CardCreatorTestExec cardcreatortest.cpp)
7269qt5_use_modules(CardCreatorTestExec Test Core Qml)
7370target_link_libraries(CardCreatorTestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
74−add_binary_qml_test(CardCreator "" "Dash-qml" "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks/")
71+add_unity8_uitest(CardCreator CardCreatorTestExec DEPENDS Dash-qml)
7572
7673# plain qml test
77−set(qmltest_DEFAULT_TARGETS qmluitests)
78−set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
79−set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LC_ALL=C")
80−add_qml_test(. ScopeStyle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
81−add_qml_test(. ListViewWithPageHeaderQML IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
82−add_qml_test(. CardAttributes IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
83−add_qml_test(. CroppedImageMinimumSourceSize IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
74+foreach(dash_test ScopeStyle ListViewWithPageHeaderQML CardAttributes CroppedImageMinimumSourceSize)
75+ add_unity8_qmltest(. ${dash_test})
76+endforeach()
tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+4−5
@@ -13,11 +13,6 @@ add_definitions(-DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
1313add_definitions(-DLAUNCHER_TESTING)
1414
1515### LauncherModelASTest
16−set(testModelCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/launchermodelastestExec
17− --parameter -o --parameter ${CMAKE_BINARY_DIR}/launchermodeltest.xml,xunitxml
18− --parameter -o --parameter -,txt)
19−add_test(NAME launchermodelastest COMMAND ${testModelCommand})
20−add_custom_target(launchermodelastest ${testModelCommand})
2116add_executable(launchermodelastestExec
2217 launchermodelastest.cpp
2318 AccountsServiceDBusAdaptor.cpp
@@ -36,6 +31,10 @@ target_link_libraries(launchermodelastestExec
3631 ${GSETTINGS_QT_LDFLAGS}
3732 )
3833qt5_use_modules(launchermodelastestExec Test Core DBus Gui)
34+add_unity8_unittest(LauncherModelAS dbus-test-runner
35+ ARG_PREFIX "--parameter"
36+ ARGS --task $<TARGET_FILE:launchermodelastestExec>
37+)
3938
4039# copy .desktop files into build directory for shadow builds
4140file(GLOB DESKTOP_FILES *.desktop)
tests/plugins/LightDM/CMakeLists.txt+9−3
@@ -28,6 +28,12 @@ target_link_libraries(GreeterUsersModelTestExec
2828
2929add_definitions(-DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
3030
31−add_binary_qml_test(GreeterDBus "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks")
32−
33−add_binary_qml_test(GreeterUsersModel "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "LIBLIGHTDM_MOCK_MODE=full")
31+add_unity8_uitest(GreeterDBus GreeterDBusTestExec
32+ ENVIRONMENT LD_LIBRARY_PATH="${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm"
33+ IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks
34+ DEPENDS MockLightDM
35+ )
36+add_unity8_uitest(GreeterUsers GreeterUsersModelTestExec
37+ ENVIRONMENT LD_LIBRARY_PATH="${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" LIBLIGHTDM_MOCK_MODE=full
38+ DEPENDS MockLightDM
39+ )
tests/plugins/Ubuntu/Gestures/CMakeLists.txt+14−24
@@ -12,40 +12,30 @@ include_directories(
1212 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
1313 )
1414
15−file(GLOB qmlFiles *.qml)
16−add_custom_target(UbuntuGesturesTestQmlFiles ALL
17− COMMAND cp ${qmlFiles} ${CMAKE_CURRENT_BINARY_DIR}
18− DEPENDS ${qmlFiles}
19−)
15+export_qmlfiles(UbuntuGesturesTest .)
2016
2117add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
2218
23−macro(add_gesture_ui_test CLASSNAME)
19+macro(add_gesture_test CLASSNAME)
2420 add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp)
2521 qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
2622 target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml UbuntuGestures)
2723
28− add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles "")
29− add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
30−endmacro(add_gesture_ui_test)
31−
32−macro(add_gesture_test CLASSNAME)
33− set(testCommand
34− ${CLASSNAME}TestExec -o ${CMAKE_BINARY_DIR}/test${CLASSNAME}.xml,xunitxml -o -,txt)
35−
36− add_test(NAME test${CLASSNAME} COMMAND ${testCommand})
37−
38− set_tests_properties(test${CLASSNAME} PROPERTIES
39− ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
24+ add_executable_test(${CLASSNAME} ${CLASSNAME}TestExec
25+ ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures
26+ DEPENDS UbuntuGesturesTest-qmlfiles
27+ ${ARGN}
28+ )
29+endmacro()
4030
41− add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp)
42− qt5_use_modules(${CLASSNAME}TestExec Test Core)
43− target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml)
44−endmacro(add_gesture_test)
31+macro(add_gesture_ui_test CLASSNAME)
32+ add_gesture_test(${CLASSNAME})
33+ add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
34+endmacro()
4535
4636add_gesture_ui_test(DirectionalDragArea)
4737add_gesture_ui_test(PressedOutsideNotifier)
4838add_gesture_ui_test(TouchDispatcher)
4939add_gesture_ui_test(TouchGate)
50−add_gesture_test(Damper)
51−add_gesture_test(AxisVelocityCalculator)
40+add_gesture_test(Damper ADD_TEST)
41+add_gesture_test(AxisVelocityCalculator ADD_TEST)
tests/plugins/Unity/Indicators/CMakeLists.txt+9−12
@@ -17,13 +17,8 @@ macro(indicator_test TEST)
1717 set(multi_value_keywords ADDITIONAL_CPPS ADDITIONAL_LIBS)
1818 cmake_parse_arguments(test "" "" "${multi_value_keywords}" ${ARGN})
1919
20− set(testCommand ${CMAKE_CURRENT_BINARY_DIR}/${TEST}Exec
21− -o ${CMAKE_BINARY_DIR}/${TEST}.xml,xunitxml
22− -o -,txt)
23− add_test(NAME ${TEST} COMMAND ${testCommand})
24− add_custom_target(${TEST} ${testCommand})
2520 add_executable(${TEST}Exec
26− ${TEST}.cpp
21+ ${TEST}Test.cpp
2722 ${test_ADDITIONAL_CPPS}
2823 )
2924 qt5_use_modules(${TEST}Exec Test Core Qml)
@@ -33,11 +28,13 @@ macro(indicator_test TEST)
3328 ${GIO_LIBRARIES}
3429 ${QMENUMODEL_LDFLAGS}
3530 )
31+
32+ add_unity8_unittest(${TEST} ${TEST}Exec)
3633endmacro(indicator_test)
3734
38−indicator_test(indicatorsmanagertest ADDITIONAL_LIBS IndicatorsQml)
39−indicator_test(indicatorsmodeltest ADDITIONAL_LIBS IndicatorsQml)
40−indicator_test(menucontentactivatortest ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp)
41−indicator_test(unitymenumodelstacktest ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp)
42−indicator_test(rootactionstatetest ADDITIONAL_LIBS IndicatorsQml)
43−indicator_test(sharedunitymenumodeltest ADDITIONAL_LIBS IndicatorsQml)
35+indicator_test(IndicatorsManager ADDITIONAL_LIBS IndicatorsQml)
36+indicator_test(IndicatorsModel ADDITIONAL_LIBS IndicatorsQml)
37+indicator_test(MenuContentActivator ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp)
38+indicator_test(UnityMenuModelStack ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp)
39+indicator_test(RootActionState ADDITIONAL_LIBS IndicatorsQml)
40+indicator_test(SharedUnityMenuModel ADDITIONAL_LIBS IndicatorsQml)
tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp → tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpprenamed+1−1
@@ -180,4 +180,4 @@ private Q_SLOTS:
180180};
181181
182182QTEST_GUILESS_MAIN(IndicatorsManagerTest)
183−#include "indicatorsmanagertest.moc"
183+#include "IndicatorsManagerTest.moc"
tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp → tests/plugins/Unity/Indicators/IndicatorsModelTest.cpprenamed+1−1
@@ -138,4 +138,4 @@ private Q_SLOTS:
138138
139139QTEST_GUILESS_MAIN(IndicatorsModelTest)
140140
141−#include "indicatorsmodeltest.moc"
141+#include "IndicatorsModelTest.moc"
tests/plugins/Unity/Indicators/menucontentactivatortest.cpp → tests/plugins/Unity/Indicators/MenuContentActivatorTest.cpprenamed+1−1
@@ -299,4 +299,4 @@ private:
299299};
300300
301301QTEST_GUILESS_MAIN(MenuConentActivatorTest)
302−#include "menucontentactivatortest.moc"
302+#include "MenuContentActivatorTest.moc"
tests/plugins/Unity/Indicators/rootactionstatetest.cpp → tests/plugins/Unity/Indicators/RootActionStateTest.cpprenamed+1−1
@@ -92,4 +92,4 @@ private Q_SLOTS:
9292};
9393
9494QTEST_GUILESS_MAIN(RootActionStateTest)
95−#include "rootactionstatetest.moc"
95+#include "RootActionStateTest.moc"
tests/plugins/Unity/Indicators/sharedunitymenumodeltest.cpp → tests/plugins/Unity/Indicators/SharedUnityMenuModelTest.cpprenamed+1−1
@@ -99,4 +99,4 @@ private Q_SLOTS:
9999};
100100
101101QTEST_GUILESS_MAIN(SharedUnityMenuModelTest)
102−#include "sharedunitymenumodeltest.moc"
102+#include "SharedUnityMenuModelTest.moc"
tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp → tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpprenamed+1−1
@@ -205,4 +205,4 @@ public:
205205};
206206
207207QTEST_GUILESS_MAIN(UnityMenuModelStackTest)
208−#include "unitymenumodelstacktest.moc"
208+#include "UnityMenuModelStackTest.moc"
tests/plugins/Unity/Launcher/CMakeLists.txt+5−5
@@ -15,11 +15,6 @@ add_definitions(-DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
1515add_definitions(-DLAUNCHER_TESTING)
1616
1717### LauncherModelTest
18−set(testModelCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/launchermodeltestExec
19− --parameter -o --parameter ${CMAKE_BINARY_DIR}/launchermodeltest.xml,xunitxml
20− --parameter -o --parameter -,txt)
21−add_test(NAME launchermodeltest COMMAND ${testModelCommand})
22−add_custom_target(launchermodeltest ${testModelCommand})
2318add_executable(launchermodeltestExec
2419 launchermodeltest.cpp
2520 gsettings.cpp
@@ -43,6 +38,11 @@ target_link_libraries(launchermodeltestExec
4338 )
4439qt5_use_modules(launchermodeltestExec Test Core DBus Xml Gui)
4540
41+add_unity8_unittest(LauncherModel dbus-test-runner
42+ ARG_PREFIX "--parameter"
43+ ARGS --task $<TARGET_FILE:launchermodeltestExec>
44+)
45+
4646# copy .desktop files into build directory for shadow builds
4747file(GLOB DESKTOP_FILES *.desktop)
4848
tests/plugins/Unity/Session/CMakeLists.txt+5−5
@@ -9,11 +9,6 @@ add_definitions(-DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
99add_definitions(-DSESSION_TESTING)
1010
1111### SessionBackendTest
12−set(testBackendCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/sessionbackendtestExec
13− --parameter -o --parameter ${CMAKE_BINARY_DIR}/sessionbackendtest.xml,xunitxml
14− --parameter -o --parameter -,txt)
15−add_test(NAME sessionbackendtest COMMAND ${testBackendCommand})
16−add_custom_target(sessionbackendtest ${testBackendCommand})
1712add_executable(sessionbackendtestExec
1813 sessionbackendtest.cpp
1914 ${CMAKE_SOURCE_DIR}/plugins/Unity/Session/dbusunitysessionservice.cpp
@@ -22,3 +17,8 @@ target_link_libraries(sessionbackendtestExec
2217 unity8-private
2318 )
2419qt5_use_modules(sessionbackendtestExec Test Core Qml DBus)
20+
21+add_unity8_unittest(SessionBackend dbus-test-runner
22+ ARG_PREFIX "--parameter"
23+ ARGS --task $<TARGET_FILE:sessionbackendtestExec>
24+)
tests/plugins/Utils/CMakeLists.txt+12−26
@@ -4,31 +4,17 @@ include_directories(
44 ${CMAKE_CURRENT_BINARY_DIR}
55 )
66
7−macro(run_tests)
8− set(_test_list "")
9− foreach(_test ${ARGN})
10− set(testCommand env "LC_ALL=C.UTF-8" ${CMAKE_CURRENT_BINARY_DIR}/${_test}Exec
11− -o ${CMAKE_BINARY_DIR}/${_test}.xml,xunitxml
12− -o -,txt)
13− add_test(NAME ${_test} COMMAND ${testCommand})
14− add_custom_target(${_test} ${testCommand})
15− add_executable(${_test}Exec ${_test}.cpp modeltest.cpp)
16− qt5_use_modules(${_test}Exec Test Core Qml)
17− target_link_libraries(${_test}Exec
18− Utils-qml
19− )
20− set(_test_list "${_test_list};${_test}")
21− endforeach()
22−endmacro(run_tests)
23−
24−run_tests(
25− qlimitproxymodeltest
26− unitysortfilterproxymodeltest
27− timeformattertest
28− homekeywatchertest
29− )
7+foreach(util_test
8+ QLimitProxyModel
9+ UnitySortFilterProxyModel
10+ TimeFormatter
11+ HomeKeyWatcher
12+)
13+ add_executable(${util_test}TestExec ${util_test}Test.cpp ModelTest.cpp)
14+ qt5_use_modules(${util_test}TestExec Test Core Qml)
15+ target_link_libraries(${util_test}TestExec Utils-qml)
16+ add_unity8_unittest(${util_test} ${util_test}TestExec ADD_TEST)
17+endforeach()
3018
3119# plain qml test
32−set(qmltest_DEFAULT_TARGETS qmltests)
33−set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
34−add_qml_test(. UtilsStyle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
20+add_unity8_qmltest(. UtilsStyle)
tests/plugins/Utils/homekeywatchertest.cpp → tests/plugins/Utils/HomeKeyWatcherTest.cpprenamed+1−1
@@ -320,4 +320,4 @@ AbstractTimer *FakeTimerFactory::create(QObject *parent)
320320
321321QTEST_GUILESS_MAIN(HomeKeyWatcherTest)
322322
323−#include "homekeywatchertest.moc"
323+#include "HomeKeyWatcherTest.moc"
tests/plugins/Utils/modeltest.cpp → tests/plugins/Utils/ModelTest.cpprenamed+1−1
@@ -47,7 +47,7 @@
4747
4848#include <QtGui/QtGui>
4949
50−#include "modeltest.h"
50+#include "ModelTest.h"
5151
5252#include <QtTest/QtTest>
5353
tests/plugins/Utils/modeltest.h → tests/plugins/Utils/ModelTest.hrenamed

The content is the same.

tests/plugins/Utils/qlimitproxymodeltest.cpp → tests/plugins/Utils/QLimitProxyModelTest.cpprenamed+2−2
@@ -16,7 +16,7 @@
1616
1717// local
1818#include "qlimitproxymodelqml.h"
19−#include "modeltest.h"
19+#include "ModelTest.h"
2020
2121// Qt
2222#include <QTest>
@@ -608,4 +608,4 @@ private Q_SLOTS:
608608
609609QTEST_GUILESS_MAIN(QLimitProxyModelTest)
610610
611−#include "qlimitproxymodeltest.moc"
611+#include "QLimitProxyModelTest.moc"
tests/plugins/Utils/timeformattertest.cpp → tests/plugins/Utils/TimeFormatterTest.cpprenamed+1−1
@@ -152,4 +152,4 @@ private Q_SLOTS:
152152
153153QTEST_GUILESS_MAIN(TimeFormatterTest)
154154
155−#include "timeformattertest.moc"
155+#include "TimeFormatterTest.moc"
tests/plugins/Utils/unitysortfilterproxymodeltest.cpp → tests/plugins/Utils/UnitySortFilterProxyModelTest.cpprenamed+2−2
@@ -19,7 +19,7 @@
1919
2020// local
2121#include "unitysortfilterproxymodelqml.h"
22−#include "modeltest.h"
22+#include "ModelTest.h"
2323
2424// Qt
2525#include <QTest>
@@ -287,4 +287,4 @@ private Q_SLOTS:
287287
288288QTEST_GUILESS_MAIN(UnitySortFilterProxyModelTest)
289289
290−#include "unitysortfilterproxymodeltest.moc"
290+#include "UnitySortFilterProxyModelTest.moc"
tests/plugins/Wizard/CMakeLists.txt+1−1
@@ -8,7 +8,7 @@ add_executable(tst-wizard-pagelist
88 ${CMAKE_SOURCE_DIR}/plugins/Wizard/PageList.cpp
99)
1010qt5_use_modules(tst-wizard-pagelist Core Qml Test)
11−add_test(NAME wizardpagelisttest COMMAND env UNITY_TESTING=1 ${CMAKE_CURRENT_BINARY_DIR}/tst-wizard-pagelist)
11+add_unity8_unittest(WizardPageList tst-wizard-pagelist)
1212
1313add_executable(tst-wizard-system
1414 tst_system.cpp
tests/qmltests/Components/CMakeLists.txt+1−1
@@ -11,7 +11,7 @@ add_executable(DragHandleTestExec tst_DragHandle.cpp)
1111qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
1212target_link_libraries(DragHandleTestExec UbuntuGesturesQml UbuntuGestures)
1313
14−add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "" "")
14+add_unity8_uitest(DragHandle DragHandleTestExec ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures)
1515add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
1616
1717add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
tests/whitespace/CMakeLists.txt+1−1
@@ -2,4 +2,4 @@
22# Test that all source files, cmakefiles, etc. do not contain trailing whitespace.
33#
44
5−add_test(whitespace ${CMAKE_CURRENT_SOURCE_DIR}/check_whitespace.py ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
5+add_test(Whitespace ${CMAKE_CURRENT_SOURCE_DIR}/check_whitespace.py ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})