Merge lp:~unity-api-team/unity-scopes-api/abi-breaks into lp:unity-scopes-api/devel
- abi-breaks
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Michal Hruby |
Approved revision: | 387 |
Merged at revision: | 386 |
Proposed branch: | lp:~unity-api-team/unity-scopes-api/abi-breaks |
Merge into: | lp:unity-scopes-api/devel |
Diff against target: |
938 lines (+73/-229) 47 files modified
CMakeLists.txt (+2/-2) HACKING (+1/-1) debian/control (+5/-3) debian/libunity-scopes2.symbols (+3/-1) demo/click/scope-click/scope-click.cpp (+1/-4) demo/scopes/scope-A/CMakeLists.txt (+2/-1) demo/scopes/scope-A/scope-A.cpp (+1/-2) demo/scopes/scope-A/scope-A.map.in (+1/-1) demo/scopes/scope-B/scope-B.cpp (+1/-3) demo/scopes/scope-C/scope-C.cpp (+1/-2) demo/scopes/scope-D/scope-D.cpp (+1/-2) demo/scopes/scope-N/scope-N.cpp (+1/-2) demo/scopes/scope-S/scope-S.cpp (+1/-2) include/unity/scopes/ScopeBase.h (+9/-17) include/unity/scopes/Version.h.in (+2/-0) include/unity/scopes/testing/TypedScopeFixture.h (+1/-2) src/scopes/ScopeBase.cpp (+10/-0) src/scopes/internal/ScopeLoader.cpp (+1/-17) test/gtest/scopes/Activation/TestScope.h (+1/-4) test/gtest/scopes/Filters/TestScope.h (+0/-8) test/gtest/scopes/IdleShutdown/SlowSearchScope.cpp (+1/-2) test/gtest/scopes/IdleShutdown/SlowSearchScope.h (+1/-1) test/gtest/scopes/Invocation/EmptyScope.cpp (+1/-2) test/gtest/scopes/Invocation/EmptyScope.h (+1/-1) test/gtest/scopes/Invocation/TestScope.cpp (+1/-2) test/gtest/scopes/Invocation/TestScope.h (+1/-1) test/gtest/scopes/Registry/scopes/testscopeA/testscopeA.cpp (+1/-4) test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp (+1/-4) test/gtest/scopes/Runtime/PusherScope.cpp (+1/-2) test/gtest/scopes/Runtime/PusherScope.h (+1/-1) test/gtest/scopes/Runtime/SlowCreateScope.cpp (+1/-2) test/gtest/scopes/Runtime/SlowCreateScope.h (+1/-1) test/gtest/scopes/Runtime/TestScope.cpp (+1/-2) test/gtest/scopes/Runtime/TestScope.h (+1/-1) test/gtest/scopes/ScopeBase/scopelib.cpp (+1/-5) test/gtest/scopes/internal/ScopeLoader/BadVersion.cpp (+0/-81) test/gtest/scopes/internal/ScopeLoader/CMakeLists.txt (+0/-1) test/gtest/scopes/internal/ScopeLoader/MyScope.h (+1/-2) test/gtest/scopes/internal/ScopeLoader/ScopeA.cpp (+1/-2) test/gtest/scopes/internal/ScopeLoader/ScopeB.cpp (+1/-2) test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp (+4/-28) test/gtest/scopes/internal/ScopeLoader/ThrowUnityExFromStart.cpp (+1/-1) test/gtest/scopes/internal/ScopeLoader/ThrowUnknownExFromStart.cpp (+1/-1) test/gtest/scopes/testing/IsolatedScope/scope.cpp (+1/-2) test/gtest/scopes/testing/IsolatedScope/scope.h (+1/-1) test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.cpp (+1/-2) test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.h (+1/-1) |
To merge this branch: | bzr merge lp:~unity-api-team/unity-scopes-api/abi-breaks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Michi Henning (community) | Approve | ||
Paweł Stołowski (community) | Approve | ||
Review via email: mp+223386@code.launchpad.net |
This proposal supersedes a proposal from 2014-06-17.
Commit message
Added the major version number to the name of the create function, so we have a version indication in the symbol table of a scope, instead of having to load the scope and calling its start() method.
Description of the change
Added the major version number to the name of the create function, so we have a version indication in the symbol table of a scope, instead of having to load the scope and calling its start() method.
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:381
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Paweł Stołowski (stolowski) wrote : | # |
I think you could remove the default empty implementations of start/stop from (some) of the test scopes (such as test/gtest/
Otherwise looks good. +1
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:384
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:385
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:386
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:386
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michi Henning (michihenning) wrote : | # |
Thanks for that. I'm sorry I didn't finish this last night, it was getting late.
I should have caught the opportunity to make start() and stop() non-pure. I think that's a nice touch.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
- 387. By Michal Hruby
-
Merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:387
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-06-11 16:25:37 +0000 |
3 | +++ CMakeLists.txt 2014-06-18 08:29:38 +0000 |
4 | @@ -181,6 +181,7 @@ |
5 | set(UNITY_SCOPES_MAJOR 0) |
6 | set(UNITY_SCOPES_MINOR 5) |
7 | set(UNITY_SCOPES_MICRO 0) |
8 | +set(UNITY_SCOPES_SOVERSION 2) |
9 | |
10 | # Version for testing, with all symbols visible |
11 | set(UNITY_SCOPES_TEST_LIB ${UNITY_SCOPES_LIB}-test) |
12 | @@ -318,7 +319,6 @@ |
13 | set_target_properties(${UNITY_SCOPES_LIB_OBJ} PROPERTIES COMPILE_FLAGS "-fPIC") |
14 | |
15 | # Use the object files to make the normal library. |
16 | -set(UNITY_SCOPES_SOVERSION 1) |
17 | add_library(${UNITY_SCOPES_LIB} SHARED $<TARGET_OBJECTS:${UNITY_SCOPES_LIB_OBJ}>) |
18 | set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES |
19 | VERSION "${UNITY_SCOPES_MAJOR}.${UNITY_SCOPES_MINOR}.${UNITY_SCOPES_MICRO}" |
20 | @@ -391,4 +391,4 @@ |
21 | DEPENDS ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}/index.html) |
22 | install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB} |
23 | DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/doc) |
24 | -endif() |
25 | \ No newline at end of file |
26 | +endif() |
27 | |
28 | === modified file 'HACKING' |
29 | --- HACKING 2014-06-12 13:09:24 +0000 |
30 | +++ HACKING 2014-06-18 08:29:38 +0000 |
31 | @@ -151,7 +151,7 @@ |
32 | $ bzr bd |
33 | $ # this will exit with an error if symbols file isn't up-to-date |
34 | $ cd ../build-area/unity-scopes-api-[version] |
35 | - $ cat ./debian/libunity-scopes1/DEBIAN/symbols | c++filt | sed 's/^ \(.*@Base\)/ (c++)"\1"/' | uniq | diff -u debian/libunity-scopes1.symbols - | sed 's/^+ \(.*@Base"\)\( .*\)/+ \1 0replaceme/' > /tmp/symbols.diff |
36 | + $ cat ./debian/libunity-scopes2/DEBIAN/symbols | c++filt | sed 's/^ \(.*@Base\)/ (c++)"\1"/' | uniq | diff -u debian/libunity-scopes2.symbols - | sed 's/^+ \(.*@Base"\)\( .*\)/+ \1 0replaceme/' > /tmp/symbols.diff |
37 | $ cd - |
38 | $ # review the symbol differences and if everything is ok, apply the diff |
39 | $ patch -p0 < /tmp/symbols.diff |
40 | |
41 | === modified file 'debian/control' |
42 | --- debian/control 2014-06-13 06:37:52 +0000 |
43 | +++ debian/control 2014-06-18 08:29:38 +0000 |
44 | @@ -33,14 +33,16 @@ |
45 | Vcs-Bzr: lp:unity-scopes-api |
46 | Vcs-Browser: https://code.launchpad.net/unity-scopes-api |
47 | |
48 | -Package: libunity-scopes1 |
49 | +Package: libunity-scopes2 |
50 | Architecture: any |
51 | Multi-Arch: same |
52 | Pre-Depends: ${misc:Pre-Depends}, |
53 | Depends: ${misc:Depends}, |
54 | ${shlibs:Depends} |
55 | Replaces: libunity-scopes0, |
56 | + libunity-scopes1, |
57 | Conflicts: libunity-scopes0, |
58 | + libunity-scopes1, |
59 | Description: API for Unity scopes integration |
60 | Library to integrate scopes with the Unity shell |
61 | |
62 | @@ -49,7 +51,7 @@ |
63 | Architecture: any |
64 | Multi-Arch: same |
65 | Pre-Depends: ${misc:Pre-Depends}, |
66 | -Depends: libunity-scopes1 (= ${binary:Version}), |
67 | +Depends: libunity-scopes2 (= ${binary:Version}), |
68 | libproperties-cpp-dev, |
69 | libunity-api-dev, |
70 | ${misc:Depends}, |
71 | @@ -61,7 +63,7 @@ |
72 | Architecture: any |
73 | Multi-Arch: foreign |
74 | Pre-Depends: ${misc:Pre-Depends}, |
75 | -Depends: libunity-scopes1 (= ${binary:Version}), |
76 | +Depends: libunity-scopes2 (= ${binary:Version}), |
77 | ${shlibs:Depends}, |
78 | ${misc:Depends}, |
79 | Description: Client utility for Unity scopes API |
80 | |
81 | === renamed file 'debian/libunity-scopes1.install' => 'debian/libunity-scopes2.install' |
82 | === renamed file 'debian/libunity-scopes1.scope.click-hook' => 'debian/libunity-scopes2.scope.click-hook' |
83 | === renamed file 'debian/libunity-scopes1.symbols' => 'debian/libunity-scopes2.symbols' |
84 | --- debian/libunity-scopes1.symbols 2014-06-17 15:43:57 +0000 |
85 | +++ debian/libunity-scopes2.symbols 2014-06-18 08:29:38 +0000 |
86 | @@ -1,4 +1,4 @@ |
87 | -libunity-scopes.so.1 libunity-scopes1 #MINVER# |
88 | +libunity-scopes.so.2 libunity-scopes2 #MINVER# |
89 | (c++)"unity::scopes::Department::add_subdepartment(std::shared_ptr<unity::scopes::Department const> const&)@Base" 0replaceme |
90 | (c++)"unity::scopes::Department::set_subdepartments(std::list<std::shared_ptr<unity::scopes::Department const>, std::allocator<std::shared_ptr<unity::scopes::Department const> > > const&)@Base" 0replaceme |
91 | (c++)"unity::scopes::Department::set_alternate_label(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme |
92 | @@ -516,6 +516,8 @@ |
93 | (c++)"unity::scopes::ScopeBase::perform_action(unity::scopes::Result const&, unity::scopes::ActionMetadata const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
94 | (c++)"unity::scopes::ScopeBase::runtime_version(int&, int&, int&)@Base" 0.4.0+14.04.20140312.1 |
95 | (c++)"unity::scopes::ScopeBase::run()@Base" 0.4.0+14.04.20140312.1 |
96 | + (c++)"unity::scopes::ScopeBase::stop()@Base" 0replaceme |
97 | + (c++)"unity::scopes::ScopeBase::start(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<unity::scopes::Registry> const&)@Base" 0replaceme |
98 | (c++)"unity::scopes::ScopeBase::activate(unity::scopes::Result const&, unity::scopes::ActionMetadata const&)@Base" 0.4.0+14.04.20140312.1 |
99 | (c++)"unity::scopes::ScopeBase::ScopeBase()@Base" 0.4.0+14.04.20140312.1 |
100 | (c++)"unity::scopes::ScopeBase::~ScopeBase()@Base" 0.4.0+14.04.20140312.1 |
101 | |
102 | === modified file 'demo/click/scope-click/scope-click.cpp' |
103 | --- demo/click/scope-click/scope-click.cpp 2014-06-12 11:24:03 +0000 |
104 | +++ demo/click/scope-click/scope-click.cpp 2014-06-18 08:29:38 +0000 |
105 | @@ -56,10 +56,7 @@ |
106 | class MyScope : public ScopeBase |
107 | { |
108 | public: |
109 | - virtual int start(string const&, RegistryProxy const&) override |
110 | - { |
111 | - return VERSION; |
112 | - } |
113 | + virtual void start(string const&, RegistryProxy const&) override {} |
114 | |
115 | virtual void stop() override {} |
116 | |
117 | |
118 | === modified file 'demo/scopes/scope-A/CMakeLists.txt' |
119 | --- demo/scopes/scope-A/CMakeLists.txt 2014-03-07 14:21:49 +0000 |
120 | +++ demo/scopes/scope-A/CMakeLists.txt 2014-06-18 08:29:38 +0000 |
121 | @@ -1,4 +1,5 @@ |
122 | -set(symbol_map "${CMAKE_CURRENT_SOURCE_DIR}/scope-A.map") |
123 | +configure_file(scope-A.map.in scope-A.map) |
124 | +set(symbol_map "${CMAKE_CURRENT_BINARY_DIR}/scope-A.map") |
125 | |
126 | add_library(scope-A MODULE scope-A.cpp) |
127 | # Add_dependencies should be used sparingly. In this case we need the global |
128 | |
129 | === modified file 'demo/scopes/scope-A/scope-A.cpp' |
130 | --- demo/scopes/scope-A/scope-A.cpp 2014-06-17 15:07:13 +0000 |
131 | +++ demo/scopes/scope-A/scope-A.cpp 2014-06-18 08:29:38 +0000 |
132 | @@ -160,10 +160,9 @@ |
133 | class MyScope : public ScopeBase |
134 | { |
135 | public: |
136 | - virtual int start(string const& scope_id, RegistryProxy const&) override |
137 | + virtual void start(string const& scope_id, RegistryProxy const&) override |
138 | { |
139 | scope_id_ = scope_id; |
140 | - return VERSION; |
141 | } |
142 | |
143 | virtual void stop() override {} |
144 | |
145 | === renamed file 'demo/scopes/scope-A/scope-A.map' => 'demo/scopes/scope-A/scope-A.map.in' |
146 | --- demo/scopes/scope-A/scope-A.map 2014-03-07 14:21:49 +0000 |
147 | +++ demo/scopes/scope-A/scope-A.map.in 2014-06-18 08:29:38 +0000 |
148 | @@ -1,6 +1,6 @@ |
149 | { |
150 | global: |
151 | - "unity_scope_create"; |
152 | + "unity_scope_create_v@UNITY_SCOPES_SOVERSION@"; |
153 | "unity_scope_destroy"; |
154 | local: |
155 | extern "C++" { |
156 | |
157 | === modified file 'demo/scopes/scope-B/scope-B.cpp' |
158 | --- demo/scopes/scope-B/scope-B.cpp 2014-06-12 11:24:03 +0000 |
159 | +++ demo/scopes/scope-B/scope-B.cpp 2014-06-18 08:29:38 +0000 |
160 | @@ -140,7 +140,7 @@ |
161 | class MyScope : public ScopeBase |
162 | { |
163 | public: |
164 | - virtual int start(string const& scope_id, RegistryProxy const& registry) override |
165 | + virtual void start(string const& scope_id, RegistryProxy const& registry) override |
166 | { |
167 | scope_id_ = scope_id; |
168 | |
169 | @@ -153,8 +153,6 @@ |
170 | scope_c_ = meta_c.proxy(); |
171 | auto meta_d = registry->get_metadata("scope-D"); |
172 | scope_d_ = meta_d.proxy(); |
173 | - |
174 | - return VERSION; |
175 | } |
176 | |
177 | virtual void stop() override {} |
178 | |
179 | === modified file 'demo/scopes/scope-C/scope-C.cpp' |
180 | --- demo/scopes/scope-C/scope-C.cpp 2014-06-13 10:17:24 +0000 |
181 | +++ demo/scopes/scope-C/scope-C.cpp 2014-06-18 08:29:38 +0000 |
182 | @@ -184,10 +184,9 @@ |
183 | class MyScope : public ScopeBase |
184 | { |
185 | public: |
186 | - virtual int start(string const& scope_id, RegistryProxy const&) override |
187 | + virtual void start(string const& scope_id, RegistryProxy const&) override |
188 | { |
189 | scope_id_ = scope_id; |
190 | - return VERSION; |
191 | } |
192 | |
193 | virtual void stop() override |
194 | |
195 | === modified file 'demo/scopes/scope-D/scope-D.cpp' |
196 | --- demo/scopes/scope-D/scope-D.cpp 2014-06-12 11:24:03 +0000 |
197 | +++ demo/scopes/scope-D/scope-D.cpp 2014-06-18 08:29:38 +0000 |
198 | @@ -183,10 +183,9 @@ |
199 | class MyScope : public ScopeBase |
200 | { |
201 | public: |
202 | - virtual int start(string const& scope_id, RegistryProxy const&) override |
203 | + virtual void start(string const& scope_id, RegistryProxy const&) override |
204 | { |
205 | scope_id_ = scope_id; |
206 | - return VERSION; |
207 | } |
208 | |
209 | virtual void stop() override |
210 | |
211 | === modified file 'demo/scopes/scope-N/scope-N.cpp' |
212 | --- demo/scopes/scope-N/scope-N.cpp 2014-06-12 11:24:03 +0000 |
213 | +++ demo/scopes/scope-N/scope-N.cpp 2014-06-18 08:29:38 +0000 |
214 | @@ -68,10 +68,9 @@ |
215 | class MyScope : public ScopeBase |
216 | { |
217 | public: |
218 | - virtual int start(string const& scope_id, RegistryProxy const&) override |
219 | + virtual void start(string const& scope_id, RegistryProxy const&) override |
220 | { |
221 | scope_id_ = scope_id; |
222 | - return VERSION; |
223 | } |
224 | |
225 | virtual void stop() override {} |
226 | |
227 | === modified file 'demo/scopes/scope-S/scope-S.cpp' |
228 | --- demo/scopes/scope-S/scope-S.cpp 2014-06-12 11:24:03 +0000 |
229 | +++ demo/scopes/scope-S/scope-S.cpp 2014-06-18 08:29:38 +0000 |
230 | @@ -85,10 +85,9 @@ |
231 | class MyScope : public ScopeBase |
232 | { |
233 | public: |
234 | - virtual int start(string const& scope_id, RegistryProxy const&) override |
235 | + virtual void start(string const& scope_id, RegistryProxy const&) override |
236 | { |
237 | scope_id_ = scope_id; |
238 | - return VERSION; |
239 | } |
240 | |
241 | virtual void stop() override {} |
242 | |
243 | === modified file 'include/unity/scopes/ScopeBase.h' |
244 | --- include/unity/scopes/ScopeBase.h 2014-04-03 14:22:02 +0000 |
245 | +++ include/unity/scopes/ScopeBase.h 2014-06-18 08:29:38 +0000 |
246 | @@ -31,7 +31,7 @@ |
247 | /** |
248 | \brief Expands to the identifier of the scope create function. @hideinitializer |
249 | */ |
250 | -#define UNITY_SCOPE_CREATE_FUNCTION unity_scope_create |
251 | +#define UNITY_SCOPE_CREATE_FUNCTION UNITY_SCOPES_VERSIONED_CREATE_SYM |
252 | |
253 | /** |
254 | \brief Expands to the identifier of the scope destroy function. @hideinitializer |
255 | @@ -90,14 +90,15 @@ |
256 | MyScope(); |
257 | virtual ~MyScope(); |
258 | |
259 | - virtual int start(); // Mandatory |
260 | - virtual void stop(); // Mandatory |
261 | + virtual void start(); // Optional |
262 | + virtual void stop(); // Optional |
263 | virtual void run(); // Optional |
264 | }; |
265 | ~~~ |
266 | |
267 | -The derived class must provide implementations of the pure virtual methods start() |
268 | -and stop(). In addition, the library must provide two functions with "C" linkage: |
269 | +The derived class gets passed an instance of RegistryProxy in the virtual method |
270 | +start(), so aggregating scopes need to override the default implementation. |
271 | +In addition, the library must provide two functions with "C" linkage: |
272 | - a create function that must return a pointer to the derived instance |
273 | - a destroy function that is passed the pointer returned by the create function |
274 | |
275 | @@ -124,7 +125,7 @@ |
276 | ~~~ |
277 | |
278 | After the scopes run time has obtained a pointer to the class instance from the create function, it calls start(), |
279 | -which allows the scope to intialize itself. This is followed by call to run(). The call to run() is made by |
280 | +which allows the scope to intialize itself. This is followed by a call to run(). The call to run() is made by |
281 | a separate thread; its only purpose is to pass a thread of control to the scope, for example, to run an event loop. |
282 | When the scope should complete its activities, the run time calls stop(). The calls to the create function, start(), |
283 | stop(), and the destroy function) are made by the same thread. |
284 | @@ -142,11 +143,6 @@ |
285 | /// @endcond |
286 | |
287 | /** |
288 | - \brief This value must be returned from the start() method. |
289 | - */ |
290 | - static constexpr int VERSION = UNITY_SCOPES_VERSION_MAJOR; |
291 | - |
292 | - /** |
293 | \brief Called by the scopes run time after the create function completes. |
294 | |
295 | If start() throws an exception, stop() will _not_ be called. |
296 | @@ -157,12 +153,8 @@ |
297 | |
298 | \param registry A proxy to the scope registry. This parameter is provided for aggregating |
299 | scopes that need to retrieve proxies to their child scopes. |
300 | - |
301 | - \return Any return value other than ScopeBase::VERSION will cause the scopes run time |
302 | - to refuse to load the scope. The return value is used to ensure that the shared library |
303 | - containing the scope is ABI compatible with the scopes run time. |
304 | */ |
305 | - virtual int start(std::string const& scope_id, RegistryProxy const& registry) = 0; |
306 | + virtual void start(std::string const& scope_id, RegistryProxy const& registry); |
307 | |
308 | /** |
309 | \brief Called by the scopes run time when the scope should shut down. |
310 | @@ -175,7 +167,7 @@ |
311 | |
312 | The call to stop() is made by the same thread that calls the create function and start(). |
313 | */ |
314 | - virtual void stop() = 0; |
315 | + virtual void stop(); |
316 | |
317 | /** |
318 | \brief Called by the scopes run time after it has called start() to hand a thread of control to the scope. |
319 | |
320 | === modified file 'include/unity/scopes/Version.h.in' |
321 | --- include/unity/scopes/Version.h.in 2014-02-18 05:04:01 +0000 |
322 | +++ include/unity/scopes/Version.h.in 2014-06-18 08:29:38 +0000 |
323 | @@ -42,6 +42,8 @@ |
324 | UNITY_SCOPES_VERSION_XSTR(UNITY_SCOPES_VERSION_MINOR) "." \ |
325 | UNITY_SCOPES_VERSION_XSTR(UNITY_SCOPES_VERSION_MICRO) |
326 | |
327 | +#define UNITY_SCOPES_VERSIONED_CREATE_SYM unity_scope_create_v ## @UNITY_SCOPES_SOVERSION@ |
328 | + |
329 | /** |
330 | \brief Top-level namespace for all things Unity-related. |
331 | */ |
332 | |
333 | === modified file 'include/unity/scopes/testing/TypedScopeFixture.h' |
334 | --- include/unity/scopes/testing/TypedScopeFixture.h 2014-03-04 01:38:13 +0000 |
335 | +++ include/unity/scopes/testing/TypedScopeFixture.h 2014-06-18 08:29:38 +0000 |
336 | @@ -64,8 +64,7 @@ |
337 | |
338 | void SetUp() |
339 | { |
340 | - EXPECT_EQ(UNITY_SCOPES_VERSION_MAJOR, |
341 | - scope->start(ScopeTraits<Scope>::name(), registry_proxy)); |
342 | + EXPECT_NO_THROW(scope->start(ScopeTraits<Scope>::name(), registry_proxy)); |
343 | EXPECT_NO_THROW(scope->run()); |
344 | } |
345 | |
346 | |
347 | === modified file 'src/scopes/ScopeBase.cpp' |
348 | --- src/scopes/ScopeBase.cpp 2014-06-13 10:17:24 +0000 |
349 | +++ src/scopes/ScopeBase.cpp 2014-06-18 08:29:38 +0000 |
350 | @@ -39,6 +39,16 @@ |
351 | |
352 | //! @endcond |
353 | |
354 | +void ScopeBase::start(std::string const&, RegistryProxy const&) |
355 | +{ |
356 | + // Intentionally empty: default "do nothing" implementation. |
357 | +} |
358 | + |
359 | +void ScopeBase::stop() |
360 | +{ |
361 | + // Intentionally empty: default "do nothing" implementation. |
362 | +} |
363 | + |
364 | void ScopeBase::run() |
365 | { |
366 | // Intentionally empty: default "do nothing" implementation. |
367 | |
368 | === modified file 'src/scopes/internal/ScopeLoader.cpp' |
369 | --- src/scopes/internal/ScopeLoader.cpp 2014-04-03 16:46:00 +0000 |
370 | +++ src/scopes/internal/ScopeLoader.cpp 2014-06-18 08:29:38 +0000 |
371 | @@ -119,23 +119,7 @@ |
372 | |
373 | try |
374 | { |
375 | - const int s_version = scope_base_->start(scope_id_, registry_); |
376 | - const int maj_version = major_version(); |
377 | - if (s_version != maj_version) |
378 | - { |
379 | - |
380 | - try |
381 | - { |
382 | - scope_base_->stop(); // Make sure to tell the scope to stop again before reporting version mismatch. |
383 | - } |
384 | - catch (...) |
385 | - { |
386 | - } |
387 | - throw unity::ResourceException("Scope " + scope_id_ + " was compiled with major version " + |
388 | - std::to_string(s_version) + " of the Unity scopes run time. This " + |
389 | - "version is incompatible with the current major " + |
390 | - "version (" + std::to_string(maj_version) + ")."); |
391 | - } |
392 | + scope_base_->start(scope_id_, registry_); |
393 | } |
394 | catch (...) |
395 | { |
396 | |
397 | === modified file 'test/gtest/scopes/Activation/TestScope.h' |
398 | --- test/gtest/scopes/Activation/TestScope.h 2014-06-13 10:17:24 +0000 |
399 | +++ test/gtest/scopes/Activation/TestScope.h 2014-06-18 08:29:38 +0000 |
400 | @@ -98,10 +98,7 @@ |
401 | class TestScope : public ScopeBase |
402 | { |
403 | public: |
404 | - virtual int start(std::string const&, RegistryProxy const &) override |
405 | - { |
406 | - return VERSION; |
407 | - } |
408 | + virtual void start(std::string const&, RegistryProxy const &) override {} |
409 | |
410 | virtual void stop() override {} |
411 | |
412 | |
413 | === modified file 'test/gtest/scopes/Filters/TestScope.h' |
414 | --- test/gtest/scopes/Filters/TestScope.h 2014-06-12 11:24:03 +0000 |
415 | +++ test/gtest/scopes/Filters/TestScope.h 2014-06-18 08:29:38 +0000 |
416 | @@ -62,14 +62,6 @@ |
417 | class TestScope : public ScopeBase |
418 | { |
419 | public: |
420 | - virtual int start(std::string const&, RegistryProxy const &) override |
421 | - { |
422 | - return VERSION; |
423 | - } |
424 | - |
425 | - virtual void stop() override {} |
426 | - virtual void run() override {} |
427 | - |
428 | virtual SearchQueryBase::UPtr search(CannedQuery const &q, SearchMetadata const &metadata) override |
429 | { |
430 | return SearchQueryBase::UPtr(new TestQuery(q, metadata)); |
431 | |
432 | === modified file 'test/gtest/scopes/IdleShutdown/SlowSearchScope.cpp' |
433 | --- test/gtest/scopes/IdleShutdown/SlowSearchScope.cpp 2014-06-12 11:24:03 +0000 |
434 | +++ test/gtest/scopes/IdleShutdown/SlowSearchScope.cpp 2014-06-18 08:29:38 +0000 |
435 | @@ -50,9 +50,8 @@ |
436 | |
437 | } // namespace |
438 | |
439 | -int SlowSearchScope::start(string const&, RegistryProxy const &) |
440 | +void SlowSearchScope::start(string const&, RegistryProxy const &) |
441 | { |
442 | - return VERSION; |
443 | } |
444 | |
445 | void SlowSearchScope::stop() |
446 | |
447 | === modified file 'test/gtest/scopes/IdleShutdown/SlowSearchScope.h' |
448 | --- test/gtest/scopes/IdleShutdown/SlowSearchScope.h 2014-05-14 04:50:14 +0000 |
449 | +++ test/gtest/scopes/IdleShutdown/SlowSearchScope.h 2014-06-18 08:29:38 +0000 |
450 | @@ -27,7 +27,7 @@ |
451 | class SlowSearchScope : public ScopeBase |
452 | { |
453 | public: |
454 | - virtual int start(string const&, RegistryProxy const &) override; |
455 | + virtual void start(string const&, RegistryProxy const &) override; |
456 | |
457 | virtual void stop() override; |
458 | |
459 | |
460 | === modified file 'test/gtest/scopes/Invocation/EmptyScope.cpp' |
461 | --- test/gtest/scopes/Invocation/EmptyScope.cpp 2014-05-13 01:40:09 +0000 |
462 | +++ test/gtest/scopes/Invocation/EmptyScope.cpp 2014-06-18 08:29:38 +0000 |
463 | @@ -49,9 +49,8 @@ |
464 | |
465 | } // namespace |
466 | |
467 | -int EmptyScope::start(string const&, RegistryProxy const &) |
468 | +void EmptyScope::start(string const&, RegistryProxy const &) |
469 | { |
470 | - return VERSION; |
471 | } |
472 | |
473 | void EmptyScope::stop() |
474 | |
475 | === modified file 'test/gtest/scopes/Invocation/EmptyScope.h' |
476 | --- test/gtest/scopes/Invocation/EmptyScope.h 2014-05-13 01:40:09 +0000 |
477 | +++ test/gtest/scopes/Invocation/EmptyScope.h 2014-06-18 08:29:38 +0000 |
478 | @@ -27,7 +27,7 @@ |
479 | class EmptyScope : public ScopeBase |
480 | { |
481 | public: |
482 | - virtual int start(string const&, RegistryProxy const &) override; |
483 | + virtual void start(string const&, RegistryProxy const &) override; |
484 | |
485 | virtual void stop() override; |
486 | |
487 | |
488 | === modified file 'test/gtest/scopes/Invocation/TestScope.cpp' |
489 | --- test/gtest/scopes/Invocation/TestScope.cpp 2014-06-16 04:11:38 +0000 |
490 | +++ test/gtest/scopes/Invocation/TestScope.cpp 2014-06-18 08:29:38 +0000 |
491 | @@ -56,9 +56,8 @@ |
492 | |
493 | } // namespace |
494 | |
495 | -int TestScope::start(string const&, RegistryProxy const &) |
496 | +void TestScope::start(string const&, RegistryProxy const &) |
497 | { |
498 | - return VERSION; |
499 | } |
500 | |
501 | void TestScope::stop() |
502 | |
503 | === modified file 'test/gtest/scopes/Invocation/TestScope.h' |
504 | --- test/gtest/scopes/Invocation/TestScope.h 2014-04-17 01:36:29 +0000 |
505 | +++ test/gtest/scopes/Invocation/TestScope.h 2014-06-18 08:29:38 +0000 |
506 | @@ -27,7 +27,7 @@ |
507 | class TestScope : public ScopeBase |
508 | { |
509 | public: |
510 | - virtual int start(string const&, RegistryProxy const &) override; |
511 | + virtual void start(string const&, RegistryProxy const &) override; |
512 | |
513 | virtual void stop() override; |
514 | |
515 | |
516 | === modified file 'test/gtest/scopes/Registry/scopes/testscopeA/testscopeA.cpp' |
517 | --- test/gtest/scopes/Registry/scopes/testscopeA/testscopeA.cpp 2014-06-12 16:16:01 +0000 |
518 | +++ test/gtest/scopes/Registry/scopes/testscopeA/testscopeA.cpp 2014-06-18 08:29:38 +0000 |
519 | @@ -64,10 +64,7 @@ |
520 | class MyScope : public ScopeBase |
521 | { |
522 | public: |
523 | - virtual int start(string const&, RegistryProxy const&) override |
524 | - { |
525 | - return VERSION; |
526 | - } |
527 | + virtual void start(string const&, RegistryProxy const&) override {} |
528 | |
529 | virtual void stop() override {} |
530 | |
531 | |
532 | === modified file 'test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp' |
533 | --- test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-06-12 16:16:01 +0000 |
534 | +++ test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-06-18 08:29:38 +0000 |
535 | @@ -77,10 +77,7 @@ |
536 | class MyScope : public ScopeBase |
537 | { |
538 | public: |
539 | - virtual int start(string const&, RegistryProxy const&) override |
540 | - { |
541 | - return VERSION; |
542 | - } |
543 | + virtual void start(string const&, RegistryProxy const&) override {} |
544 | |
545 | virtual void stop() override {} |
546 | |
547 | |
548 | === modified file 'test/gtest/scopes/Runtime/PusherScope.cpp' |
549 | --- test/gtest/scopes/Runtime/PusherScope.cpp 2014-03-31 14:29:50 +0000 |
550 | +++ test/gtest/scopes/Runtime/PusherScope.cpp 2014-06-18 08:29:38 +0000 |
551 | @@ -69,9 +69,8 @@ |
552 | |
553 | } // namespace |
554 | |
555 | -int PusherScope::start(string const&, RegistryProxy const &) |
556 | +void PusherScope::start(string const&, RegistryProxy const &) |
557 | { |
558 | - return VERSION; |
559 | } |
560 | |
561 | void PusherScope::stop() |
562 | |
563 | === modified file 'test/gtest/scopes/Runtime/PusherScope.h' |
564 | --- test/gtest/scopes/Runtime/PusherScope.h 2014-03-31 14:29:50 +0000 |
565 | +++ test/gtest/scopes/Runtime/PusherScope.h 2014-06-18 08:29:38 +0000 |
566 | @@ -27,7 +27,7 @@ |
567 | class PusherScope : public ScopeBase |
568 | { |
569 | public: |
570 | - virtual int start(string const&, RegistryProxy const &) override; |
571 | + virtual void start(string const&, RegistryProxy const &) override; |
572 | |
573 | virtual void stop() override; |
574 | |
575 | |
576 | === modified file 'test/gtest/scopes/Runtime/SlowCreateScope.cpp' |
577 | --- test/gtest/scopes/Runtime/SlowCreateScope.cpp 2014-04-16 03:57:48 +0000 |
578 | +++ test/gtest/scopes/Runtime/SlowCreateScope.cpp 2014-06-18 08:29:38 +0000 |
579 | @@ -70,9 +70,8 @@ |
580 | |
581 | } // namespace |
582 | |
583 | -int SlowCreateScope::start(string const&, RegistryProxy const &) |
584 | +void SlowCreateScope::start(string const&, RegistryProxy const &) |
585 | { |
586 | - return VERSION; |
587 | } |
588 | |
589 | void SlowCreateScope::stop() |
590 | |
591 | === modified file 'test/gtest/scopes/Runtime/SlowCreateScope.h' |
592 | --- test/gtest/scopes/Runtime/SlowCreateScope.h 2014-03-31 14:29:50 +0000 |
593 | +++ test/gtest/scopes/Runtime/SlowCreateScope.h 2014-06-18 08:29:38 +0000 |
594 | @@ -27,7 +27,7 @@ |
595 | class SlowCreateScope : public ScopeBase |
596 | { |
597 | public: |
598 | - virtual int start(string const&, RegistryProxy const &) override; |
599 | + virtual void start(string const&, RegistryProxy const &) override; |
600 | |
601 | virtual void stop() override; |
602 | |
603 | |
604 | === modified file 'test/gtest/scopes/Runtime/TestScope.cpp' |
605 | --- test/gtest/scopes/Runtime/TestScope.cpp 2014-06-04 10:16:52 +0000 |
606 | +++ test/gtest/scopes/Runtime/TestScope.cpp 2014-06-18 08:29:38 +0000 |
607 | @@ -107,9 +107,8 @@ |
608 | } |
609 | }; |
610 | |
611 | -int TestScope::start(string const&, RegistryProxy const &) |
612 | +void TestScope::start(string const&, RegistryProxy const &) |
613 | { |
614 | - return VERSION; |
615 | } |
616 | |
617 | void TestScope::stop() |
618 | |
619 | === modified file 'test/gtest/scopes/Runtime/TestScope.h' |
620 | --- test/gtest/scopes/Runtime/TestScope.h 2014-03-31 14:29:50 +0000 |
621 | +++ test/gtest/scopes/Runtime/TestScope.h 2014-06-18 08:29:38 +0000 |
622 | @@ -27,7 +27,7 @@ |
623 | class TestScope : public ScopeBase |
624 | { |
625 | public: |
626 | - virtual int start(string const&, RegistryProxy const &) override; |
627 | + virtual void start(string const&, RegistryProxy const &) override; |
628 | |
629 | virtual void stop() override; |
630 | |
631 | |
632 | === modified file 'test/gtest/scopes/ScopeBase/scopelib.cpp' |
633 | --- test/gtest/scopes/ScopeBase/scopelib.cpp 2014-02-27 23:20:56 +0000 |
634 | +++ test/gtest/scopes/ScopeBase/scopelib.cpp 2014-06-18 08:29:38 +0000 |
635 | @@ -25,11 +25,7 @@ |
636 | public: |
637 | MyScope() {} |
638 | |
639 | - virtual int start(std::string const&, unity::scopes::RegistryProxy const&) override |
640 | - { |
641 | - return VERSION; |
642 | - } |
643 | - |
644 | + virtual void start(std::string const&, unity::scopes::RegistryProxy const&) override {} |
645 | virtual void stop() override {} |
646 | virtual void run() override {} |
647 | |
648 | |
649 | === removed file 'test/gtest/scopes/internal/ScopeLoader/BadVersion.cpp' |
650 | --- test/gtest/scopes/internal/ScopeLoader/BadVersion.cpp 2014-02-27 23:20:56 +0000 |
651 | +++ test/gtest/scopes/internal/ScopeLoader/BadVersion.cpp 1970-01-01 00:00:00 +0000 |
652 | @@ -1,81 +0,0 @@ |
653 | -/* |
654 | - * Copyright (C) 2013 Canonical Ltd |
655 | - * |
656 | - * This program is free software: you can redistribute it and/or modify |
657 | - * it under the terms of the GNU Lesser General Public License version 3 as |
658 | - * published by the Free Software Foundation. |
659 | - * |
660 | - * This program is distributed in the hope that it will be useful, |
661 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
662 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
663 | - * GNU Lesser General Public License for more details. |
664 | - * |
665 | - * You should have received a copy of the GNU Lesser General Public License |
666 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
667 | - * |
668 | - * Authored by: Michi Henning <michi.henning@canonical.com> |
669 | - */ |
670 | - |
671 | -// Force Version.h to use the specified version, so we get coverage on the version check. |
672 | - |
673 | -#define UNITY_SCOPES_VERSION_MAJOR 666 |
674 | - |
675 | -#include "Counters.h" |
676 | - |
677 | -#include <unity/scopes/internal/ScopeLoader.h> |
678 | -#include <unity/scopes/CannedQuery.h> |
679 | - |
680 | -#include <iostream> |
681 | - |
682 | -class EXPORT MyScope : public unity::scopes::ScopeBase |
683 | -{ |
684 | -public: |
685 | - MyScope() {} |
686 | - virtual ~MyScope() {} |
687 | - |
688 | - virtual int start(std::string const&, unity::scopes::RegistryProxy const&) override |
689 | - { |
690 | - inc_start(); |
691 | - return VERSION; |
692 | - } |
693 | - |
694 | - virtual void stop() override |
695 | - { |
696 | - inc_stop(); |
697 | - } |
698 | - |
699 | - virtual unity::scopes::SearchQueryBase::UPtr search(unity::scopes::CannedQuery const&, |
700 | - unity::scopes::SearchMetadata const&) override |
701 | - { |
702 | - return nullptr; |
703 | - } |
704 | - |
705 | - virtual unity::scopes::PreviewQueryBase::UPtr preview(unity::scopes::Result const&, |
706 | - unity::scopes::ActionMetadata const&) override |
707 | - { |
708 | - return nullptr; |
709 | - } |
710 | -}; |
711 | - |
712 | -extern "C" |
713 | -{ |
714 | - |
715 | - EXPORT |
716 | - unity::scopes::ScopeBase* |
717 | - // cppcheck-suppress unusedFunction |
718 | - UNITY_SCOPE_CREATE_FUNCTION() |
719 | - { |
720 | - inc_create(); |
721 | - return new MyScope; |
722 | - } |
723 | - |
724 | - EXPORT |
725 | - void |
726 | - // cppcheck-suppress unusedFunction |
727 | - UNITY_SCOPE_DESTROY_FUNCTION(unity::scopes::ScopeBase* scope_base) |
728 | - { |
729 | - inc_destroy(); |
730 | - delete scope_base; |
731 | - } |
732 | - |
733 | -} |
734 | |
735 | === modified file 'test/gtest/scopes/internal/ScopeLoader/CMakeLists.txt' |
736 | --- test/gtest/scopes/internal/ScopeLoader/CMakeLists.txt 2013-12-20 05:07:03 +0000 |
737 | +++ test/gtest/scopes/internal/ScopeLoader/CMakeLists.txt 2014-06-18 08:29:38 +0000 |
738 | @@ -5,7 +5,6 @@ |
739 | |
740 | add_library(SharedState SHARED Counters.cpp PerScopeVariables.cpp) |
741 | |
742 | -add_library(BadVersion MODULE BadVersion.cpp) |
743 | add_library(NoDestroy MODULE NoDestroy.cpp) |
744 | add_library(NullReturn MODULE NullReturn.cpp) |
745 | add_library(ScopeA MODULE ScopeA.cpp) |
746 | |
747 | === modified file 'test/gtest/scopes/internal/ScopeLoader/MyScope.h' |
748 | --- test/gtest/scopes/internal/ScopeLoader/MyScope.h 2014-02-27 23:20:56 +0000 |
749 | +++ test/gtest/scopes/internal/ScopeLoader/MyScope.h 2014-06-18 08:29:38 +0000 |
750 | @@ -31,10 +31,9 @@ |
751 | MyScope() {} |
752 | virtual ~MyScope() {} |
753 | |
754 | - virtual int start(std::string const&, unity::scopes::RegistryProxy const&) override |
755 | + virtual void start(std::string const&, unity::scopes::RegistryProxy const&) override |
756 | { |
757 | inc_start(); |
758 | - return VERSION; |
759 | } |
760 | |
761 | virtual void stop() override |
762 | |
763 | === modified file 'test/gtest/scopes/internal/ScopeLoader/ScopeA.cpp' |
764 | --- test/gtest/scopes/internal/ScopeLoader/ScopeA.cpp 2014-01-09 11:59:34 +0000 |
765 | +++ test/gtest/scopes/internal/ScopeLoader/ScopeA.cpp 2014-06-18 08:29:38 +0000 |
766 | @@ -30,10 +30,9 @@ |
767 | class ScopeA : public MyScope |
768 | { |
769 | public: |
770 | - virtual int start(std::string const&, unity::scopes::RegistryProxy const&) override |
771 | + virtual void start(std::string const&, unity::scopes::RegistryProxy const&) override |
772 | { |
773 | inc_start(); |
774 | - return VERSION; |
775 | } |
776 | |
777 | virtual void stop() override |
778 | |
779 | === modified file 'test/gtest/scopes/internal/ScopeLoader/ScopeB.cpp' |
780 | --- test/gtest/scopes/internal/ScopeLoader/ScopeB.cpp 2014-01-09 11:59:34 +0000 |
781 | +++ test/gtest/scopes/internal/ScopeLoader/ScopeB.cpp 2014-06-18 08:29:38 +0000 |
782 | @@ -30,10 +30,9 @@ |
783 | class ScopeA : public MyScope |
784 | { |
785 | public: |
786 | - virtual int start(std::string const&, unity::scopes::RegistryProxy const&) override |
787 | + virtual void start(std::string const&, unity::scopes::RegistryProxy const&) override |
788 | { |
789 | inc_start(); |
790 | - return VERSION; |
791 | } |
792 | |
793 | virtual void stop() override |
794 | |
795 | === modified file 'test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp' |
796 | --- test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp 2014-04-03 16:46:00 +0000 |
797 | +++ test/gtest/scopes/internal/ScopeLoader/ScopeLoader_test.cpp 2014-06-18 08:29:38 +0000 |
798 | @@ -37,7 +37,6 @@ |
799 | { |
800 | |
801 | char const* scope_lib = TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeLoader/libTestScope.so"; |
802 | -char const* bad_version_lib = TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeLoader/libBadVersion.so"; |
803 | char const* no_destroy_lib = TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeLoader/libNoDestroy.so"; |
804 | char const* null_return_lib = TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeLoader/libNullReturn.so"; |
805 | char const* throw_unity_ex_from_start_lib |
806 | @@ -82,31 +81,6 @@ |
807 | EXPECT_EQ(0, num_stop()); |
808 | } |
809 | |
810 | -TEST(ScopeLoader, version_mismatch) |
811 | -{ |
812 | - reset_counters(); |
813 | - |
814 | - try |
815 | - { |
816 | - ScopeLoader::UPtr sl = ScopeLoader::load("testScope", bad_version_lib, registry); |
817 | - sl->start(); |
818 | - sl->unload(); |
819 | - FAIL(); |
820 | - } |
821 | - catch (unity::Exception const& e) |
822 | - { |
823 | - boost::regex r("unity::ResourceException: Scope testScope: terminated due to exception in start\\(\\):\n" |
824 | - " unity::ResourceException: Scope testScope was compiled with major version 666 of the " |
825 | - "Unity scopes run time. This version is incompatible with the current major version " |
826 | - "\\([0-9]+\\)\\."); |
827 | - EXPECT_TRUE(boost::regex_match(e.what(), r)) << e.what(); |
828 | - } |
829 | - EXPECT_EQ(1, num_create()); |
830 | - EXPECT_EQ(1, num_destroy()); |
831 | - EXPECT_EQ(1, num_start()); |
832 | - EXPECT_EQ(1, num_stop()); |
833 | -} |
834 | - |
835 | TEST(ScopeLoader, stop) |
836 | { |
837 | reset_counters(); |
838 | @@ -215,7 +189,8 @@ |
839 | } |
840 | catch (unity::Exception const& e) |
841 | { |
842 | - EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create", |
843 | + EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from " |
844 | + UNITY_SCOPE_CREATE_SYMSTR, |
845 | e.what()); |
846 | EXPECT_EQ(1, num_create()); |
847 | EXPECT_EQ(0, num_destroy()); |
848 | @@ -236,7 +211,8 @@ |
849 | } |
850 | catch (unity::Exception const& e) |
851 | { |
852 | - EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from unity_scope_create", |
853 | + EXPECT_STREQ("unity::ResourceException: Scope testScope returned nullptr from " |
854 | + UNITY_SCOPE_CREATE_SYMSTR, |
855 | e.what()); |
856 | EXPECT_EQ(1, num_create()); |
857 | EXPECT_EQ(0, num_destroy()); |
858 | |
859 | === modified file 'test/gtest/scopes/internal/ScopeLoader/ThrowUnityExFromStart.cpp' |
860 | --- test/gtest/scopes/internal/ScopeLoader/ThrowUnityExFromStart.cpp 2014-01-09 11:59:34 +0000 |
861 | +++ test/gtest/scopes/internal/ScopeLoader/ThrowUnityExFromStart.cpp 2014-06-18 08:29:38 +0000 |
862 | @@ -29,7 +29,7 @@ |
863 | class EXPORT MyThrowingScope : public MyScope |
864 | { |
865 | public: |
866 | - virtual int start(std::string const&, unity::scopes::RegistryProxy const&) override |
867 | + virtual void start(std::string const&, unity::scopes::RegistryProxy const&) override |
868 | { |
869 | inc_start(); |
870 | throw unity::LogicException("start failure"); |
871 | |
872 | === modified file 'test/gtest/scopes/internal/ScopeLoader/ThrowUnknownExFromStart.cpp' |
873 | --- test/gtest/scopes/internal/ScopeLoader/ThrowUnknownExFromStart.cpp 2014-01-09 11:59:34 +0000 |
874 | +++ test/gtest/scopes/internal/ScopeLoader/ThrowUnknownExFromStart.cpp 2014-06-18 08:29:38 +0000 |
875 | @@ -28,7 +28,7 @@ |
876 | class EXPORT MyThrowingScope : public MyScope |
877 | { |
878 | public: |
879 | - virtual int start(std::string const&, unity::scopes::RegistryProxy const&) override |
880 | + virtual void start(std::string const&, unity::scopes::RegistryProxy const&) override |
881 | { |
882 | inc_start(); |
883 | throw 42; |
884 | |
885 | === modified file 'test/gtest/scopes/testing/IsolatedScope/scope.cpp' |
886 | --- test/gtest/scopes/testing/IsolatedScope/scope.cpp 2014-06-17 15:07:13 +0000 |
887 | +++ test/gtest/scopes/testing/IsolatedScope/scope.cpp 2014-06-18 08:29:38 +0000 |
888 | @@ -125,9 +125,8 @@ |
889 | |
890 | } // namespace testing |
891 | |
892 | -int testing::Scope::start(std::string const&, unity::scopes::RegistryProxy const &) |
893 | +void testing::Scope::start(std::string const&, unity::scopes::RegistryProxy const &) |
894 | { |
895 | - return VERSION; |
896 | } |
897 | |
898 | void testing::Scope::stop() |
899 | |
900 | === modified file 'test/gtest/scopes/testing/IsolatedScope/scope.h' |
901 | --- test/gtest/scopes/testing/IsolatedScope/scope.h 2014-02-27 23:29:10 +0000 |
902 | +++ test/gtest/scopes/testing/IsolatedScope/scope.h 2014-06-18 08:29:38 +0000 |
903 | @@ -25,7 +25,7 @@ |
904 | class Scope : public unity::scopes::ScopeBase |
905 | { |
906 | public: |
907 | - int start(std::string const&, unity::scopes::RegistryProxy const &) override; |
908 | + void start(std::string const&, unity::scopes::RegistryProxy const &) override; |
909 | |
910 | void stop() override; |
911 | |
912 | |
913 | === modified file 'test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.cpp' |
914 | --- test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.cpp 2014-06-13 10:17:24 +0000 |
915 | +++ test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.cpp 2014-06-18 08:29:38 +0000 |
916 | @@ -155,9 +155,8 @@ |
917 | { |
918 | } |
919 | |
920 | -int testing::Scope::start(std::string const&, unity::scopes::RegistryProxy const &) |
921 | +void testing::Scope::start(std::string const&, unity::scopes::RegistryProxy const &) |
922 | { |
923 | - return VERSION; |
924 | } |
925 | |
926 | void testing::Scope::stop() |
927 | |
928 | === modified file 'test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.h' |
929 | --- test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.h 2014-03-06 10:15:39 +0000 |
930 | +++ test/gtest/scopes/testing/IsolatedScopeBenchmark/scope.h 2014-06-18 08:29:38 +0000 |
931 | @@ -30,7 +30,7 @@ |
932 | public: |
933 | Scope(const std::chrono::milliseconds& mean, const std::chrono::milliseconds& variance); |
934 | |
935 | - int start(std::string const&, unity::scopes::RegistryProxy const &) override; |
936 | + void start(std::string const&, unity::scopes::RegistryProxy const &) override; |
937 | |
938 | void stop() override; |
939 |
166 +#define UNITY_SCOPE_ CREATE_ FUNCTION unity_scope_ create_ v@UNITY_ SCOPES_ MAJOR@
The library SOVERSION should be used here, not the MAJOR version, can you add the SOVERSION definition to Version.h, and just use a ## macro here? The fewer generated headers the better.
Otherwise looking fine...