Merge lp:~dobey/unity-scope-click/move-configuration into lp:unity-scope-click/devel

Proposed by dobey
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 259
Merged at revision: 266
Proposed branch: lp:~dobey/unity-scope-click/move-configuration
Merge into: lp:unity-scope-click/devel
Prerequisite: lp:~dobey/unity-scope-click/search-haljson
Diff against target: 187 lines (+66/-14)
8 files modified
CMakeLists.txt (+8/-0)
libclickscope/CMakeLists.txt (+1/-0)
libclickscope/click/CMakeLists.txt (+1/-2)
libclickscope/tests/CMakeLists.txt (+51/-0)
scope/click/CMakeLists.txt (+0/-2)
scope/click/index.h (+2/-1)
scope/click/webclient.cpp (+2/-1)
scope/tests/CMakeLists.txt (+1/-8)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/move-configuration
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+220070@code.launchpad.net

Commit message

Move the Configuration and test to libclickscope.
Move gmock embedding to top level of the tree.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-05-14 21:50:52 +0000
3+++ CMakeLists.txt 2014-05-19 14:42:36 +0000
4@@ -35,6 +35,14 @@
5 SET (SCOPE_LIB_UNVERSIONED clickscope)
6 SET (SCOPE_LIB_NAME ${SCOPE_LIB_UNVERSIONED}-${SCOPE_LIB_API_VERSION})
7
8+# Build with system gmock and embedded gtest
9+set (GMOCK_INCLUDE_DIR "/usr/include/gmock/include" CACHE PATH "gmock source include directory")
10+set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
11+set (GTEST_INCLUDE_DIR "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory")
12+
13+add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
14+
15+# Add our own subdirectories.
16 add_subdirectory(autopilot)
17 add_subdirectory(libclickscope)
18 add_subdirectory(scope)
19
20=== modified file 'libclickscope/CMakeLists.txt'
21--- libclickscope/CMakeLists.txt 2014-05-13 19:32:29 +0000
22+++ libclickscope/CMakeLists.txt 2014-05-19 14:42:36 +0000
23@@ -1,1 +1,2 @@
24 add_subdirectory(click)
25+add_subdirectory(tests)
26
27=== modified file 'libclickscope/click/CMakeLists.txt'
28--- libclickscope/click/CMakeLists.txt 2014-05-13 19:32:29 +0000
29+++ libclickscope/click/CMakeLists.txt 2014-05-19 14:42:36 +0000
30@@ -9,6 +9,7 @@
31 )
32
33 add_library(${SCOPE_LIB_NAME} STATIC
34+ configuration.cpp
35 key_file_locator.cpp
36 )
37
38@@ -16,8 +17,6 @@
39 ${JSON_CPP_INCLUDE_DIRS}
40 )
41
42-qt5_use_modules (${SCOPE_LIB_NAME} Network)
43-
44 target_link_libraries (${SCOPE_LIB_NAME}
45 ${JSON_CPP_LDFLAGS}
46 ${UNITY_SCOPES_LDFLAGS}
47
48=== renamed file 'scope/click/configuration.cpp' => 'libclickscope/click/configuration.cpp'
49=== renamed file 'scope/click/configuration.h' => 'libclickscope/click/configuration.h'
50=== added file 'libclickscope/tests/CMakeLists.txt'
51--- libclickscope/tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
52+++ libclickscope/tests/CMakeLists.txt 2014-05-19 14:42:36 +0000
53@@ -0,0 +1,51 @@
54+set (LIBCLICKSCOPE_TESTS_TARGET libclick-scope-tests)
55+find_package(Threads)
56+
57+# Qt5 bits
58+SET (CMAKE_INCLUDE_CURRENT_DIR ON)
59+SET (CMAKE_AUTOMOC ON)
60+
61+find_package(Qt5Core REQUIRED)
62+
63+include_directories (
64+ ${CMAKE_SOURCE_DIR}/libclickscope
65+ ${JSON_CPP_INCLUDE_DIRS}
66+ ${GTEST_INCLUDE_DIR}
67+ ${GMOCK_INCLUDE_DIR}
68+)
69+
70+add_executable (${LIBCLICKSCOPE_TESTS_TARGET}
71+ test_configuration.cpp
72+)
73+
74+qt5_use_modules(${LIBCLICKSCOPE_TESTS_TARGET} Core)
75+
76+target_link_libraries(${LIBCLICKSCOPE_TESTS_TARGET}
77+ ${SCOPE_LIB_NAME}
78+
79+ ${UNITY_SCOPES_LDFLAGS}
80+ ${UBUNTUONE_LDFLAGS}
81+ ${UBUNTU_DOWNLOAD_MANAGER_CLIENT_LDFLAGS}
82+ ${UBUNTU_DOWNLOAD_MANAGER_COMMON_LDFLAGS}
83+ ${JSON_CPP_LDFLAGS}
84+
85+ gmock
86+ gmock_main
87+
88+ ${CMAKE_THREAD_LIBS_INIT}
89+)
90+
91+add_custom_target (test-libclickscope
92+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIBCLICKSCOPE_TESTS_TARGET}
93+ DEPENDS ${LIBCLICKSCOPE_TESTS_TARGET}
94+)
95+
96+add_custom_target (test-libclickscope-valgrind
97+ COMMAND valgrind --tool=memcheck ${CMAKE_CURRENT_BINARY_DIR}/${LIBCLICKSCOPE_TESTS_TARGET}
98+ DEPENDS ${LIBCLICKSCOPE_TESTS_TARGET}
99+)
100+
101+add_custom_target (test-libclickscope-leaks
102+ COMMAND valgrind --tool=memcheck --track-origins=yes --num-callers=40 --leak-resolution=high --leak-check=full ${CMAKE_CURRENT_BINARY_DIR}/${LIBCLICKSCOPE_TESTS_TARGET}
103+ DEPENDS ${LIBCLICKSCOPE_TESTS_TARGET}
104+)
105
106=== renamed file 'scope/tests/test_configuration.cpp' => 'libclickscope/tests/test_configuration.cpp'
107=== modified file 'scope/click/CMakeLists.txt'
108--- scope/click/CMakeLists.txt 2014-05-13 19:32:29 +0000
109+++ scope/click/CMakeLists.txt 2014-05-19 14:42:36 +0000
110@@ -9,7 +9,6 @@
111 )
112
113 add_library(${SCOPE_LIB_UNVERSIONED} SHARED
114- configuration.cpp
115 download-manager.cpp
116 index.cpp
117 interface.cpp
118@@ -35,7 +34,6 @@
119 qt5_use_modules (${SCOPE_LIB_UNVERSIONED} Network)
120
121 target_link_libraries (${SCOPE_LIB_UNVERSIONED}
122- -L${CMAKE_BINARY_DIR}/libclickscope
123 ${SCOPE_LIB_NAME}
124 ${JSON_CPP_LDFLAGS}
125 ${UNITY_SCOPES_LDFLAGS}
126
127=== modified file 'scope/click/index.h'
128--- scope/click/index.h 2014-05-19 14:42:36 +0000
129+++ scope/click/index.h 2014-05-19 14:42:36 +0000
130@@ -34,7 +34,8 @@
131 #include <string>
132 #include <functional>
133
134-#include "configuration.h"
135+#include <click/configuration.h>
136+
137 #include "package.h"
138 #include "webclient.h"
139
140
141=== modified file 'scope/click/webclient.cpp'
142--- scope/click/webclient.cpp 2014-05-13 15:34:17 +0000
143+++ scope/click/webclient.cpp 2014-05-19 14:42:36 +0000
144@@ -30,7 +30,8 @@
145 #include <QBuffer>
146 #include <QDebug>
147
148-#include "configuration.h"
149+#include <click/configuration.h>
150+
151 #include "webclient.h"
152 #include "smartconnect.h"
153
154
155=== modified file 'scope/tests/CMakeLists.txt'
156--- scope/tests/CMakeLists.txt 2014-05-14 21:50:52 +0000
157+++ scope/tests/CMakeLists.txt 2014-05-19 14:42:36 +0000
158@@ -1,13 +1,6 @@
159 set (CLICKSCOPE_TESTS_TARGET click-scope-tests)
160 find_package(Threads)
161
162-# Build with system gmock and embedded gtest
163-set (GMOCK_INCLUDE_DIR "/usr/include/gmock/include" CACHE PATH "gmock source include directory")
164-set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
165-set (GTEST_INCLUDE_DIR "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory")
166-
167-add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
168-
169 # Qt5 bits
170 SET (CMAKE_INCLUDE_CURRENT_DIR ON)
171 SET (CMAKE_AUTOMOC ON)
172@@ -27,7 +20,6 @@
173 add_executable (${CLICKSCOPE_TESTS_TARGET}
174 mock_network_access_manager.h
175 mock_webclient.h
176- test_configuration.cpp
177 test_download_manager.cpp
178 test_index.cpp
179 test_interface.cpp
180@@ -43,6 +35,7 @@
181
182 target_link_libraries(${CLICKSCOPE_TESTS_TARGET}
183 ${SCOPE_LIB_UNVERSIONED}
184+ ${SCOPE_LIB_NAME}
185
186 ${UNITY_SCOPES_LDFLAGS}
187 ${UBUNTUONE_LDFLAGS}

Subscribers

People subscribed via source and target branches

to all changes: