Merge lp:~unity-team/unity/phablet.unittests_new-cmake into lp:unity/phablet

Proposed by Andrea Cimitan
Status: Rejected
Rejected by: Michał Sawicz
Proposed branch: lp:~unity-team/unity/phablet.unittests_new-cmake
Merge into: lp:unity/phablet
Diff against target: 45 lines (+28/-3)
2 files modified
tests/unittests/CMakeLists.txt (+27/-2)
tests/unittests/tst_AnimationControllerWithSignals.qml (+1/-1)
To merge this branch: bzr merge lp:~unity-team/unity/phablet.unittests_new-cmake
Reviewer Review Type Date Requested Status
Michał Sawicz Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+154401@code.launchpad.net

Commit message

New CMakeLists for unittests allowing import paths.

Description of the change

New CMakeLists for unittests allowing import paths.

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

This means that "make test" nor "make check" will not run those tests, is that on purpose?

Why are we _not_ using add_test() in the macro and a custom target instead?

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :
review: Disapprove

Unmerged revisions

500. By Andrea Cimitan

Changed Test name for AnimationControllerWithSignals

499. By Andrea Cimitan

New CMakeLists.txt for unittests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/unittests/CMakeLists.txt'
2--- tests/unittests/CMakeLists.txt 2013-03-14 15:27:09 +0000
3+++ tests/unittests/CMakeLists.txt 2013-03-20 15:13:38 +0000
4@@ -1,2 +1,27 @@
5-add_test(tst_QmlTests qmltestrunner -input ${CMAKE_SOURCE_DIR}/tests/unittests/ -o ${CMAKE_BINARY_DIR}/qmltestrun.xml,xunitxml -o -,txt)
6-set_tests_properties(tst_QmlTests PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
7+add_custom_target(tests)
8+
9+# add_qml_test(COMPONENT_NAME [IMPORT_PATH])
10+macro(add_qml_test COMPONENT_NAME)
11+ if(${ARGC} EQUAL 1)
12+ add_custom_target(test${COMPONENT_NAME}
13+ qmltestrunner -input ${CMAKE_CURRENT_SOURCE_DIR}/tst_${COMPONENT_NAME}.qml
14+ -o ${CMAKE_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml
15+ -o -,txt)
16+ else(${ARGC} EQUAL 1)
17+ add_custom_target(test${COMPONENT_NAME}
18+ qmltestrunner -input ${CMAKE_CURRENT_SOURCE_DIR}/tst_${COMPONENT_NAME}.qml
19+ -import ${ARGV1}
20+ -o ${CMAKE_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml
21+ -o -,txt)
22+ endif(${ARGC} EQUAL 1)
23+
24+ set_target_properties(test${COMPONENT_NAME} PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
25+ add_dependencies(tests test${COMPONENT_NAME})
26+endmacro(add_qml_test)
27+
28+add_qml_test(AnimationControllerWithSignals)
29+add_qml_test(Carousel)
30+add_qml_test(CrossFadeImage)
31+add_qml_test(MathLocal)
32+add_qml_test(RatingStars)
33+add_qml_test(TimeLocal)
34
35=== modified file 'tests/unittests/tst_AnimationControllerWithSignals.qml'
36--- tests/unittests/tst_AnimationControllerWithSignals.qml 2013-03-14 12:32:50 +0000
37+++ tests/unittests/tst_AnimationControllerWithSignals.qml 2013-03-20 15:13:38 +0000
38@@ -20,7 +20,7 @@
39
40 TestCase {
41 id: testCase
42- name: "AnimationControllerWithSignals"
43+ name: "AnimationControllerWithSignalsTest"
44
45 property real someNumber: 0.0
46

Subscribers

People subscribed via source and target branches

to all changes: