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
=== modified file '.bzrignore'
--- .bzrignore 2013-06-06 10:51:04 +0000
+++ .bzrignore 2013-07-02 10:31:26 +0000
@@ -15,11 +15,7 @@
15src/config.h15src/config.h
16src/webbrowser-app16src/webbrowser-app
17src/webbrowser-app.desktop17src/webbrowser-app.desktop
18tests/unittests/tst_QmlTests18RE:tests/unittests/.+/tst_\w+Tests$
19tests/unittests/tst_CommandLineParserTests
20tests/unittests/tst_HistoryModelTests
21tests/unittests/tst_HistoryMatchesModelTests
22tests/unittests/tst_TabsModelTests
23po/*.gmo19po/*.gmo
2420
25obj-*21obj-*
2622
=== modified file 'tests/unittests/CMakeLists.txt'
--- tests/unittests/CMakeLists.txt 2013-06-12 07:04:55 +0000
+++ tests/unittests/CMakeLists.txt 2013-07-02 10:31:26 +0000
@@ -1,49 +1,5 @@
1add_executable(tst_QmlTests tst_QmlTests.cpp)1add_subdirectory(qml)
2qt5_use_modules(tst_QmlTests Core Qml Quick Test QuickTest)2add_subdirectory(commandline-parser)
3target_link_libraries(tst_QmlTests ${TPL_QT5_LIBRARIES})3add_subdirectory(history-model)
4add_test(tst_QmlTests ${CMAKE_CURRENT_BINARY_DIR}/tst_QmlTests -import ${CMAKE_BINARY_DIR}/src)4add_subdirectory(history-matches-model)
5set_tests_properties(tst_QmlTests PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")5add_subdirectory(tabs-model)
6
7# copy qml test files to build dir
8file(GLOB qmlTestFiles RELATIVE ${CMAKE_SOURCE_DIR}/tests/unittests/ *qml)
9foreach(qmlTestFile ${qmlTestFiles})
10 file(COPY ${qmlTestFile} DESTINATION ${CMAKE_BINARY_DIR}/tests/unittests/)
11endforeach(qmlTestFile)
12
13set(CLP_SRC
14 ${webbrowser-app_SOURCE_DIR}/commandline-parser.cpp
15 tst_CommandLineParserTests.cpp
16)
17add_executable(tst_CommandLineParserTests ${CLP_SRC})
18include_directories(${webbrowser-app_SOURCE_DIR} ${webbrowser-app_BINARY_DIR})
19qt5_use_modules(tst_CommandLineParserTests Core Test)
20add_test(tst_CommandLineParserTests ${CMAKE_CURRENT_BINARY_DIR}/tst_CommandLineParserTests)
21
22set(HM_SRC
23 ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
24 tst_HistoryModelTests.cpp
25)
26add_executable(tst_HistoryModelTests ${HM_SRC})
27include_directories(${webbrowser-plugin_SOURCE_DIR})
28qt5_use_modules(tst_HistoryModelTests Core Sql Test)
29add_test(tst_HistoryModelTests ${CMAKE_CURRENT_BINARY_DIR}/tst_HistoryModelTests)
30
31set(HMM_SRC
32 ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
33 ${webbrowser-plugin_SOURCE_DIR}/history-matches-model.cpp
34 tst_HistoryMatchesModelTests.cpp
35)
36add_executable(tst_HistoryMatchesModelTests ${HMM_SRC})
37include_directories(${webbrowser-plugin_SOURCE_DIR})
38qt5_use_modules(tst_HistoryMatchesModelTests Core Sql Test)
39add_test(tst_HistoryMatchesModelTests ${CMAKE_CURRENT_BINARY_DIR}/tst_HistoryMatchesModelTests)
40
41set(TM_SRC
42 ${webbrowser-plugin_SOURCE_DIR}/tabs-model.cpp
43 tst_TabsModelTests.cpp
44)
45add_executable(tst_TabsModelTests ${TM_SRC})
46include_directories(${webbrowser-plugin_SOURCE_DIR})
47qt5_use_modules(tst_TabsModelTests Core Quick Test)
48add_test(tst_TabsModelTests ${CMAKE_CURRENT_BINARY_DIR}/tst_TabsModelTests)
49set_tests_properties(tst_TabsModelTests PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
506
=== added directory 'tests/unittests/commandline-parser'
=== added file 'tests/unittests/commandline-parser/CMakeLists.txt'
--- tests/unittests/commandline-parser/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/unittests/commandline-parser/CMakeLists.txt 2013-07-02 10:31:26 +0000
@@ -0,0 +1,9 @@
1set(TEST tst_CommandLineParserTests)
2set(SOURCES
3 ${webbrowser-app_SOURCE_DIR}/commandline-parser.cpp
4 tst_CommandLineParserTests.cpp
5)
6add_executable(${TEST} ${SOURCES})
7include_directories(${webbrowser-app_SOURCE_DIR} ${webbrowser-app_BINARY_DIR})
8qt5_use_modules(${TEST} Core Test)
9add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
010
=== renamed file 'tests/unittests/tst_CommandLineParserTests.cpp' => 'tests/unittests/commandline-parser/tst_CommandLineParserTests.cpp'
=== added directory 'tests/unittests/history-matches-model'
=== added file 'tests/unittests/history-matches-model/CMakeLists.txt'
--- tests/unittests/history-matches-model/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/unittests/history-matches-model/CMakeLists.txt 2013-07-02 10:31:26 +0000
@@ -0,0 +1,10 @@
1set(TEST tst_HistoryMatchesModelTests)
2set(SOURCES
3 ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
4 ${webbrowser-plugin_SOURCE_DIR}/history-matches-model.cpp
5 tst_HistoryMatchesModelTests.cpp
6)
7add_executable(${TEST} ${SOURCES})
8include_directories(${webbrowser-plugin_SOURCE_DIR})
9qt5_use_modules(${TEST} Core Sql Test)
10add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
011
=== renamed file 'tests/unittests/tst_HistoryMatchesModelTests.cpp' => 'tests/unittests/history-matches-model/tst_HistoryMatchesModelTests.cpp'
=== added directory 'tests/unittests/history-model'
=== added file 'tests/unittests/history-model/CMakeLists.txt'
--- tests/unittests/history-model/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/unittests/history-model/CMakeLists.txt 2013-07-02 10:31:26 +0000
@@ -0,0 +1,9 @@
1set(TEST tst_HistoryModelTests)
2set(SOURCES
3 ${webbrowser-plugin_SOURCE_DIR}/history-model.cpp
4 tst_HistoryModelTests.cpp
5)
6add_executable(${TEST} ${SOURCES})
7include_directories(${webbrowser-plugin_SOURCE_DIR})
8qt5_use_modules(${TEST} Core Sql Test)
9add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
010
=== renamed file 'tests/unittests/tst_HistoryModelTests.cpp' => 'tests/unittests/history-model/tst_HistoryModelTests.cpp'
=== added directory 'tests/unittests/qml'
=== added file 'tests/unittests/qml/CMakeLists.txt'
--- tests/unittests/qml/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/unittests/qml/CMakeLists.txt 2013-07-02 10:31:26 +0000
@@ -0,0 +1,11 @@
1set(TEST tst_QmlTests)
2add_executable(${TEST} tst_QmlTests.cpp)
3qt5_use_modules(${TEST} Core Qml Quick Test QuickTest)
4add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST} -import ${CMAKE_BINARY_DIR}/src)
5set_tests_properties(${TEST} PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
6
7# copy qml test files to build dir
8file(GLOB qmlTestFiles RELATIVE ${CMAKE_SOURCE_DIR}/tests/unittests/qml/ *qml)
9foreach(qmlTestFile ${qmlTestFiles})
10 file(COPY ${qmlTestFile} DESTINATION ${CMAKE_BINARY_DIR}/tests/unittests/qml/)
11endforeach(qmlTestFile)
012
=== renamed file 'tests/unittests/tst_AddressBar.qml' => 'tests/unittests/qml/tst_AddressBar.qml'
=== renamed file 'tests/unittests/tst_Chrome.qml' => 'tests/unittests/qml/tst_Chrome.qml'
=== renamed file 'tests/unittests/tst_QmlTests.cpp' => 'tests/unittests/qml/tst_QmlTests.cpp'
=== added directory 'tests/unittests/tabs-model'
=== added file 'tests/unittests/tabs-model/CMakeLists.txt'
--- tests/unittests/tabs-model/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/unittests/tabs-model/CMakeLists.txt 2013-07-02 10:31:26 +0000
@@ -0,0 +1,10 @@
1set(TEST tst_TabsModelTests)
2set(SOURCES
3 ${webbrowser-plugin_SOURCE_DIR}/tabs-model.cpp
4 tst_TabsModelTests.cpp
5)
6add_executable(${TEST} ${SOURCES})
7include_directories(${webbrowser-plugin_SOURCE_DIR})
8qt5_use_modules(${TEST} Core Quick Test)
9add_test(${TEST} ${CMAKE_CURRENT_BINARY_DIR}/${TEST})
10set_tests_properties(${TEST} PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
011
=== 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: