Merge lp:~osomon/webbrowser-app/separate-unittests into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Ugo Riboni
Approved revision: 206
Merged at revision: 203
Proposed branch: lp:~osomon/webbrowser-app/separate-unittests
Merge into: lp:webbrowser-app
Diff against target: 162 lines (+55/-54)
7 files modified
.bzrignore (+1/-5)
tests/unittests/CMakeLists.txt (+5/-49)
tests/unittests/commandline-parser/CMakeLists.txt (+9/-0)
tests/unittests/history-matches-model/CMakeLists.txt (+10/-0)
tests/unittests/history-model/CMakeLists.txt (+9/-0)
tests/unittests/qml/CMakeLists.txt (+11/-0)
tests/unittests/tabs-model/CMakeLists.txt (+10/-0)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/separate-unittests
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ugo Riboni (community) Approve
Review via email: mp+172529@code.launchpad.net

Commit message

Move unit tests to separate directories.

To post a comment you must log in.
205. By Olivier Tilloy

Define a variable with the name of the test executable.

206. By Olivier Tilloy

Remove unused target_link_libraries directive.

Revision history for this message
Ugo Riboni (uriboni) wrote :

Tests still pass and the new layout looks clearer to me.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2013-06-06 10:51:04 +0000
3+++ .bzrignore 2013-07-02 10:31:26 +0000
4@@ -15,11 +15,7 @@
5 src/config.h
6 src/webbrowser-app
7 src/webbrowser-app.desktop
8-tests/unittests/tst_QmlTests
9-tests/unittests/tst_CommandLineParserTests
10-tests/unittests/tst_HistoryModelTests
11-tests/unittests/tst_HistoryMatchesModelTests
12-tests/unittests/tst_TabsModelTests
13+RE:tests/unittests/.+/tst_\w+Tests$
14 po/*.gmo
15
16 obj-*
17
18=== modified file 'tests/unittests/CMakeLists.txt'
19--- tests/unittests/CMakeLists.txt 2013-06-12 07:04:55 +0000
20+++ tests/unittests/CMakeLists.txt 2013-07-02 10:31:26 +0000
21@@ -1,49 +1,5 @@
22-add_executable(tst_QmlTests tst_QmlTests.cpp)
23-qt5_use_modules(tst_QmlTests Core Qml Quick Test QuickTest)
24-target_link_libraries(tst_QmlTests ${TPL_QT5_LIBRARIES})
25-add_test(tst_QmlTests ${CMAKE_CURRENT_BINARY_DIR}/tst_QmlTests -import ${CMAKE_BINARY_DIR}/src)
26-set_tests_properties(tst_QmlTests PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
27-
28-# copy qml test files to build dir
29-file(GLOB qmlTestFiles RELATIVE ${CMAKE_SOURCE_DIR}/tests/unittests/ *qml)
30-foreach(qmlTestFile ${qmlTestFiles})
31- file(COPY ${qmlTestFile} DESTINATION ${CMAKE_BINARY_DIR}/tests/unittests/)
32-endforeach(qmlTestFile)
33-
34-set(CLP_SRC
35- ${webbrowser-app_SOURCE_DIR}/commandline-parser.cpp
36- tst_CommandLineParserTests.cpp
37-)
38-add_executable(tst_CommandLineParserTests ${CLP_SRC})
39-include_directories(${webbrowser-app_SOURCE_DIR} ${webbrowser-app_BINARY_DIR})
40-qt5_use_modules(tst_CommandLineParserTests Core Test)
41-add_test(tst_CommandLineParserTests ${CMAKE_CURRENT_BINARY_DIR}/tst_CommandLineParserTests)
42-
43-set(HM_SRC
44- ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
45- tst_HistoryModelTests.cpp
46-)
47-add_executable(tst_HistoryModelTests ${HM_SRC})
48-include_directories(${webbrowser-plugin_SOURCE_DIR})
49-qt5_use_modules(tst_HistoryModelTests Core Sql Test)
50-add_test(tst_HistoryModelTests ${CMAKE_CURRENT_BINARY_DIR}/tst_HistoryModelTests)
51-
52-set(HMM_SRC
53- ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
54- ${webbrowser-plugin_SOURCE_DIR}/history-matches-model.cpp
55- tst_HistoryMatchesModelTests.cpp
56-)
57-add_executable(tst_HistoryMatchesModelTests ${HMM_SRC})
58-include_directories(${webbrowser-plugin_SOURCE_DIR})
59-qt5_use_modules(tst_HistoryMatchesModelTests Core Sql Test)
60-add_test(tst_HistoryMatchesModelTests ${CMAKE_CURRENT_BINARY_DIR}/tst_HistoryMatchesModelTests)
61-
62-set(TM_SRC
63- ${webbrowser-plugin_SOURCE_DIR}/tabs-model.cpp
64- tst_TabsModelTests.cpp
65-)
66-add_executable(tst_TabsModelTests ${TM_SRC})
67-include_directories(${webbrowser-plugin_SOURCE_DIR})
68-qt5_use_modules(tst_TabsModelTests Core Quick Test)
69-add_test(tst_TabsModelTests ${CMAKE_CURRENT_BINARY_DIR}/tst_TabsModelTests)
70-set_tests_properties(tst_TabsModelTests PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
71+add_subdirectory(qml)
72+add_subdirectory(commandline-parser)
73+add_subdirectory(history-model)
74+add_subdirectory(history-matches-model)
75+add_subdirectory(tabs-model)
76
77=== added directory 'tests/unittests/commandline-parser'
78=== added file 'tests/unittests/commandline-parser/CMakeLists.txt'
79--- tests/unittests/commandline-parser/CMakeLists.txt 1970-01-01 00:00:00 +0000
80+++ tests/unittests/commandline-parser/CMakeLists.txt 2013-07-02 10:31:26 +0000
81@@ -0,0 +1,9 @@
82+set(TEST tst_CommandLineParserTests)
83+set(SOURCES
84+ ${webbrowser-app_SOURCE_DIR}/commandline-parser.cpp
85+ tst_CommandLineParserTests.cpp
86+)
87+add_executable(${TEST} ${SOURCES})
88+include_directories(${webbrowser-app_SOURCE_DIR} ${webbrowser-app_BINARY_DIR})
89+qt5_use_modules(${TEST} Core Test)
90+add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
91
92=== renamed file 'tests/unittests/tst_CommandLineParserTests.cpp' => 'tests/unittests/commandline-parser/tst_CommandLineParserTests.cpp'
93=== added directory 'tests/unittests/history-matches-model'
94=== added file 'tests/unittests/history-matches-model/CMakeLists.txt'
95--- tests/unittests/history-matches-model/CMakeLists.txt 1970-01-01 00:00:00 +0000
96+++ tests/unittests/history-matches-model/CMakeLists.txt 2013-07-02 10:31:26 +0000
97@@ -0,0 +1,10 @@
98+set(TEST tst_HistoryMatchesModelTests)
99+set(SOURCES
100+ ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
101+ ${webbrowser-plugin_SOURCE_DIR}/history-matches-model.cpp
102+ tst_HistoryMatchesModelTests.cpp
103+)
104+add_executable(${TEST} ${SOURCES})
105+include_directories(${webbrowser-plugin_SOURCE_DIR})
106+qt5_use_modules(${TEST} Core Sql Test)
107+add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
108
109=== renamed file 'tests/unittests/tst_HistoryMatchesModelTests.cpp' => 'tests/unittests/history-matches-model/tst_HistoryMatchesModelTests.cpp'
110=== added directory 'tests/unittests/history-model'
111=== added file 'tests/unittests/history-model/CMakeLists.txt'
112--- tests/unittests/history-model/CMakeLists.txt 1970-01-01 00:00:00 +0000
113+++ tests/unittests/history-model/CMakeLists.txt 2013-07-02 10:31:26 +0000
114@@ -0,0 +1,9 @@
115+set(TEST tst_HistoryModelTests)
116+set(SOURCES
117+ ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
118+ tst_HistoryModelTests.cpp
119+)
120+add_executable(${TEST} ${SOURCES})
121+include_directories(${webbrowser-plugin_SOURCE_DIR})
122+qt5_use_modules(${TEST} Core Sql Test)
123+add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
124
125=== renamed file 'tests/unittests/tst_HistoryModelTests.cpp' => 'tests/unittests/history-model/tst_HistoryModelTests.cpp'
126=== added directory 'tests/unittests/qml'
127=== added file 'tests/unittests/qml/CMakeLists.txt'
128--- tests/unittests/qml/CMakeLists.txt 1970-01-01 00:00:00 +0000
129+++ tests/unittests/qml/CMakeLists.txt 2013-07-02 10:31:26 +0000
130@@ -0,0 +1,11 @@
131+set(TEST tst_QmlTests)
132+add_executable(${TEST} tst_QmlTests.cpp)
133+qt5_use_modules(${TEST} Core Qml Quick Test QuickTest)
134+add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST} -import ${CMAKE_BINARY_DIR}/src)
135+set_tests_properties(${TEST} PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
136+
137+# copy qml test files to build dir
138+file(GLOB qmlTestFiles RELATIVE ${CMAKE_SOURCE_DIR}/tests/unittests/qml/ *qml)
139+foreach(qmlTestFile ${qmlTestFiles})
140+ file(COPY ${qmlTestFile} DESTINATION ${CMAKE_BINARY_DIR}/tests/unittests/qml/)
141+endforeach(qmlTestFile)
142
143=== renamed file 'tests/unittests/tst_AddressBar.qml' => 'tests/unittests/qml/tst_AddressBar.qml'
144=== renamed file 'tests/unittests/tst_Chrome.qml' => 'tests/unittests/qml/tst_Chrome.qml'
145=== renamed file 'tests/unittests/tst_QmlTests.cpp' => 'tests/unittests/qml/tst_QmlTests.cpp'
146=== added directory 'tests/unittests/tabs-model'
147=== added file 'tests/unittests/tabs-model/CMakeLists.txt'
148--- tests/unittests/tabs-model/CMakeLists.txt 1970-01-01 00:00:00 +0000
149+++ tests/unittests/tabs-model/CMakeLists.txt 2013-07-02 10:31:26 +0000
150@@ -0,0 +1,10 @@
151+set(TEST tst_TabsModelTests)
152+set(SOURCES
153+ ${webbrowser-plugin_SOURCE_DIR}/tabs-model.cpp
154+ tst_TabsModelTests.cpp
155+)
156+add_executable(${TEST} ${SOURCES})
157+include_directories(${webbrowser-plugin_SOURCE_DIR})
158+qt5_use_modules(${TEST} Core Quick Test)
159+add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
160+set_tests_properties(${TEST} PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
161
162=== renamed file 'tests/unittests/tst_TabsModelTests.cpp' => 'tests/unittests/tabs-model/tst_TabsModelTests.cpp'

Subscribers

People subscribed via source and target branches

to status/vote changes: