Merge lp://staging/~michihenning/unity-scopes-api/qt-coverage into lp://staging/unity-scopes-api/devel

Proposed by Michi Henning
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 333
Merged at revision: 561
Proposed branch: lp://staging/~michihenning/unity-scopes-api/qt-coverage
Merge into: lp://staging/unity-scopes-api/devel
Diff against target: 4126 lines (+1451/-872)
80 files modified
CMakeLists.txt (+1/-1)
RELEASE_NOTES.md (+6/-0)
debian/changelog (+8/-0)
debian/libunity-scopes-qt.symbols (+278/-377)
include/unity/scopes/internal/' (+0/-59)
include/unity/scopes/qt/HttpAsyncReader.h (+17/-16)
include/unity/scopes/qt/JsonAsyncReader.h (+17/-16)
include/unity/scopes/qt/JsonReader.h (+11/-10)
include/unity/scopes/qt/QActionMetadata.h (+5/-0)
include/unity/scopes/qt/QCannedQuery.h (+4/-0)
include/unity/scopes/qt/QCategorisedResult.h (+4/-0)
include/unity/scopes/qt/QCategory.h (+4/-0)
include/unity/scopes/qt/QColumnLayout.h (+4/-0)
include/unity/scopes/qt/QDepartment.h (+5/-3)
include/unity/scopes/qt/QPreviewQueryBase.h (+4/-0)
include/unity/scopes/qt/QPreviewQueryBaseAPI.h (+13/-0)
include/unity/scopes/qt/QPreviewReply.h (+4/-0)
include/unity/scopes/qt/QPreviewReplyProxy.h (+4/-0)
include/unity/scopes/qt/QPreviewWidget.h (+4/-0)
include/unity/scopes/qt/QResult.h (+4/-0)
include/unity/scopes/qt/QScopeBase.h (+4/-0)
include/unity/scopes/qt/QScopeBaseAPI.h (+4/-0)
include/unity/scopes/qt/QSearchMetadata.h (+4/-0)
include/unity/scopes/qt/QSearchQueryBase.h (+4/-0)
include/unity/scopes/qt/QSearchQueryBaseAPI.h (+12/-0)
include/unity/scopes/qt/QSearchReply.h (+4/-0)
include/unity/scopes/qt/QSearchReplyProxy.h (+4/-0)
include/unity/scopes/qt/QVariantBuilder.h (+11/-6)
include/unity/scopes/qt/XmlAsyncReader.h (+17/-16)
include/unity/scopes/qt/XmlReader.h (+11/-10)
include/unity/scopes/qt/internal/QScopeBaseAPIImpl.h (+2/-2)
include/unity/scopes/qt/internal/QUtils.h (+13/-8)
src/scopes/qt/CMakeLists.txt (+35/-33)
src/scopes/qt/HttpAsyncReader.cpp (+0/-2)
src/scopes/qt/JsonAsyncReader.cpp (+0/-1)
src/scopes/qt/JsonReader.cpp (+0/-1)
src/scopes/qt/QPreviewQueryBaseAPI.cpp (+6/-3)
src/scopes/qt/QResult.cpp (+0/-1)
src/scopes/qt/QSearchMetadata.cpp (+0/-1)
src/scopes/qt/QSearchQueryBaseAPI.cpp (+10/-4)
src/scopes/qt/QVariantBuilder.cpp (+5/-0)
src/scopes/qt/XmlAsyncReader.cpp (+0/-1)
src/scopes/qt/XmlReader.cpp (+0/-1)
src/scopes/qt/internal/QActionMetadataImpl.cpp (+5/-6)
src/scopes/qt/internal/QCannedQueryImpl.cpp (+2/-2)
src/scopes/qt/internal/QCategoryImpl.cpp (+2/-2)
src/scopes/qt/internal/QColumnLayoutImpl.cpp (+2/-3)
src/scopes/qt/internal/QDepartmentImpl.cpp (+5/-5)
src/scopes/qt/internal/QPreviewReplyImpl.cpp (+2/-3)
src/scopes/qt/internal/QPreviewWidgetImpl.cpp (+4/-4)
src/scopes/qt/internal/QResultImpl.cpp (+4/-4)
src/scopes/qt/internal/QScopeBaseAPIImpl.cpp (+20/-16)
src/scopes/qt/internal/QScopeVariant.cpp (+6/-6)
src/scopes/qt/internal/QSearchMetadataImpl.cpp (+4/-5)
src/scopes/qt/internal/QUtils.cpp (+30/-15)
src/scopes/qt/internal/QVariantBuilderImpl.cpp (+5/-9)
test/gtest/scopes/qt/CMakeLists.txt (+2/-0)
test/gtest/scopes/qt/JsonAsyncReader/JsonAsyncReader_test.cpp (+1/-6)
test/gtest/scopes/qt/XmlAsyncReader/XmlAsyncReader_test.cpp (+1/-4)
test/gtest/scopes/qt/qt-bindings/BasicEventsChecker.h (+129/-0)
test/gtest/scopes/qt/qt-bindings/CMakeLists.txt (+19/-0)
test/gtest/scopes/qt/qt-bindings/FakeScope.h (+3/-5)
test/gtest/scopes/qt/qt-bindings/QActionMetadata_test.cpp (+3/-3)
test/gtest/scopes/qt/qt-bindings/QCannedQuery_test.cpp (+31/-7)
test/gtest/scopes/qt/qt-bindings/QCategorisedResult_test.cpp (+27/-6)
test/gtest/scopes/qt/qt-bindings/QColumnLayout_test.cpp (+38/-9)
test/gtest/scopes/qt/qt-bindings/QDepartment_test.cpp (+55/-9)
test/gtest/scopes/qt/qt-bindings/QEventTypeMatcher.h (+11/-8)
test/gtest/scopes/qt/qt-bindings/QMockScope.h (+7/-8)
test/gtest/scopes/qt/qt-bindings/QPreviewQueryBaseAPI_test.cpp (+102/-45)
test/gtest/scopes/qt/qt-bindings/QScopeBaseAPIImpl_test.cpp (+7/-9)
test/gtest/scopes/qt/qt-bindings/QScopeBaseAPIMock.h (+3/-3)
test/gtest/scopes/qt/qt-bindings/QScopeCreation_test.cpp (+7/-7)
test/gtest/scopes/qt/qt-bindings/QSearchMetadata_test.cpp (+3/-3)
test/gtest/scopes/qt/qt-bindings/QSearchQueryBaseAPI_test.cpp (+85/-28)
test/gtest/scopes/qt/qt-bindings/QUtils_test.cpp (+167/-0)
test/gtest/scopes/qt/qt-bindings/QVariantBuilder_test.cpp (+45/-7)
test/gtest/scopes/qt/qt-bindings/TestSetup.h (+25/-24)
test/headers/compile_headers.py (+1/-2)
tools/symbol_diff.in (+45/-27)
To merge this branch: bzr merge lp://staging/~michihenning/unity-scopes-api/qt-coverage
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Paweł Stołowski (community) Approve
Review via email: mp+251199@code.staging.launchpad.net

This proposal supersedes a proposal from 2015-02-19.

Commit message

Lots of clean-up on the qt lib. This is stage 1, more to follow.

- Merged Xavi's changes for failing tests, QDepartmentList
  definition, and missing _ENABLE_QT_EXPERIMENTAL_.

- Many style fixes.

- Fixed infinite loop in QVariantMap to VariantMap conversion.

- Removed camel case for conversion functions.

- Test coverage for QVariant, QUtils, QCategorisedResult,
  QCategory, QDepartment, QColumnLayout

- Added qt lib to symbol diff script and fixed symbols file.

- Made copyright headers consistent.

- Fixed broken QSearchMetadataImpl::has_location()

Description of the change

Lots of clean-up on the qt lib. This is stage 1, more to follow.

- Merged Xavi's changes for failing tests, QDepartmentList
  definition, and missing _ENABLE_QT_EXPERIMENTAL_.

- Many style fixes.

- Fixed infinite loop in QVariantMap to VariantMap conversion.

- Removed camel case for conversion functions.

- Test coverage for QVariant, QUtils, QCategorisedResult,
  QCategory, QDepartment, QColumnLayout

- Added qt lib to symbol diff script and fixed symbols file.

- Made copyright headers consistent.

- Fixed broken QSearchMetadataImpl::has_location()

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

Oh wow, quite a lot of changes and cleanups, thanks for that Michi!

A couple of minor remarks:

1235 +// TODO: These are in the public API, so they need documentation.

Good point; should they actually be part of the public API? I think we're hiding scopes::Variant everywhere and only expose QVariant and do the conversions internally. Would it make sense to hide them instead?

766 + * Copyright (C) 2013 Canonical Ltd
2353 + * Copyright (C) 2014 Canonical Ltd

Bump the year please (there are more of them, just pasting two examples) :)

35 +unity-scopes-api (0.6.15+15.04.20150213-0ubuntu2) UNRELEASED; urgency=medium

The beloved changelog! Should say 0.6.15-0ubuntu1 ;)

I think it would probably make sense to put _ENABLE_QT_EXPERIMENTAL_ in a separate include file, and just #include that everywhere, but feel free to leave it as is; since it's a temporary measure there is no need to put more effort into changing all that again. On second thought, you probably had a good reason to copy-paste it everywhere (better error message from the compiler about offending include file?) ;)

I'm a bit baffled by the amount of changes to symbols file; is it just about re-sorting them?

review: Needs Fixing
Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote : Posted in a previous version of this proposal

Regarding: 1235 +// TODO: These are in the public API, so they need documentation.

I agree with Pawel. Maybe we should hide the full header from the public API and move it to the internal directory.

Those functions should not be used by any Qt user as they should only deal with QVariant.

Regarding the dates: most of the files were created in 2015, so not sure if we should use 2015 instead.

Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote : Posted in a previous version of this proposal

Regarding the _ENABLE_QT_EXPERIMENTAL_ I added it explicitly to all the headers to make any potencial user completely aware that he/she must use the flag. I thought that "hiding" the flag into another header would possibly be less clear to the final user, but it's fine with me to use that approach instead.

Revision history for this message
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

> 1235 +// TODO: These are in the public API, so they need documentation.
>
> Good point; should they actually be part of the public API? I think we're
> hiding scopes::Variant everywhere and only expose QVariant and do the
> conversions internally. Would it make sense to hide them instead?
>
> 766 + * Copyright (C) 2013 Canonical Ltd
> 2353 + * Copyright (C) 2014 Canonical Ltd
>
> Bump the year please (there are more of them, just pasting two examples) :)

I've gone through and checked them all. I found one that had 2013 instead of 2014 (HttpAsyncReader.h). The others all have 2014. I think that's right, seeing that Xavi was working on this last year.

> 35 +unity-scopes-api (0.6.15+15.04.20150213-0ubuntu2) UNRELEASED;
> urgency=medium
>
> The beloved changelog! Should say 0.6.15-0ubuntu1 ;)

Ah, my good old friend, the changelog... Neither "dch" nor "dch -i" does the right thing. Is there a magic incantation that does?

> > I think it would probably make sense to put _ENABLE_QT_EXPERIMENTAL_ in a
> separate include file, and just #include that everywhere, but feel free to
> leave it as is; since it's a temporary measure there is no need to put more
> effort into changing all that again. On second thought, you probably had a
> good reason to copy-paste it everywhere (better error message from the
> compiler about offending include file?) ;)

Yes, that's one reason. Also, I don't like "artificial" public headers. I've removed the EXPERIMENTAL thingy from all the internal header files though. It's not needed there; we only need it in the public headers.

> I'm a bit baffled by the amount of changes to symbols file; is it just about
> re-sorting them?

Yes. It turns out that the qt lib wasn't processed by the symbol_diff script, so we didn't get automatic diffs if bzr bd complained. I added processing for the qt lib to the script, so that's fixed now. The script sorts the symbol file and puts it through uniq (it has to because, otherwise, we end up with more and more duplicate lines in the file), which is why there is that large diff.

I've moved the QUtils functions into the internal namespace. (That also caused a change in the symbols file.)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

Thank you so much, Mr Jenkins.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote : Posted in a previous version of this proposal

> > The beloved changelog! Should say 0.6.15-0ubuntu1 ;)
>
> Ah, my good old friend, the changelog... Neither "dch" nor "dch -i" does the
> right thing. Is there a magic incantation that does?

No idea; I think it can't deal with the version numbers generated by our autolanding machinery.

>
> I've moved the QUtils functions into the internal namespace. (That also caused
> a change in the symbols file.)
Thanks!

review: Approve
Revision history for this message
Paweł Stołowski (stolowski) wrote : Posted in a previous version of this proposal

Michi, I've no luck running the updated diff_script, it's failing to do the job in different ways:

4006 + with open('/tmp/symbols.diff', 'a') as outfile:

this change seems to be problematic, I'm getting an error saying /tmp/symbols.diff doesn't exist on start. It proceeds if I create an empty file in tmp. But then it fails in later steps.

The line #94 of the script which prints the exception needs to use .decode(...) on the line, e.g.

"raise Exception('Cannot parse demangled line: ' + line.decode('utf8'))"

otherwise it fails with error about str + bytes concatenation.

After fixing that line, it fails with this:

vivid@vivid:/src/unity-scopes-api/build-area/unity-scopes-api-0.6.15$ ./obj-x86_64-linux-gnu/tools/symbol_diff
Traceback (most recent call last):
  File "./obj-x86_64-linux-gnu/tools/symbol_diff", line 113, in <module>
    run()
  File "./obj-x86_64-linux-gnu/tools/symbol_diff", line 110, in run
    compare_syms(old_file, new_file)
  File "./obj-x86_64-linux-gnu/tools/symbol_diff", line 94, in compare_syms
    raise Exception('Cannot parse demangled line: ' + line.decode('utf8'))
Exception: Cannot parse demangled line: libunity-scopes.so.3 libunity-scopes3 #MINVER#

review: Needs Fixing
Revision history for this message
Paweł Stołowski (stolowski) wrote : Posted in a previous version of this proposal

To clarify - this fails to regenerate symbols for me in my canned-query-data branch, based on this branch.

> Michi, I've no luck running the updated diff_script, it's failing to do the
> job in different ways:
>
> 4006 + with open('/tmp/symbols.diff', 'a') as outfile:
>
> this change seems to be problematic, I'm getting an error saying
> /tmp/symbols.diff doesn't exist on start. It proceeds if I create an empty
> file in tmp. But then it fails in later steps.
>
> The line #94 of the script which prints the exception needs to use
> .decode(...) on the line, e.g.
>
> "raise Exception('Cannot parse demangled line: ' + line.decode('utf8'))"
>
> otherwise it fails with error about str + bytes concatenation.
>
> After fixing that line, it fails with this:
>
> vivid@vivid:/src/unity-scopes-api/build-area/unity-scopes-api-0.6.15$ ./obj-
> x86_64-linux-gnu/tools/symbol_diff
> Traceback (most recent call last):
> File "./obj-x86_64-linux-gnu/tools/symbol_diff", line 113, in <module>
> run()
> File "./obj-x86_64-linux-gnu/tools/symbol_diff", line 110, in run
> compare_syms(old_file, new_file)
> File "./obj-x86_64-linux-gnu/tools/symbol_diff", line 94, in compare_syms
> raise Exception('Cannot parse demangled line: ' + line.decode('utf8'))
> Exception: Cannot parse demangled line: libunity-scopes.so.3 libunity-scopes3
> #MINVER#

Revision history for this message
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

Aargh, my apologies! Will fix straight away.

Revision history for this message
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

BTW, as an emergency fix, just back out the last commit to the script, and it should work for the libunity-scopes3 symbols file.

Revision history for this message
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

OK, should be good now. I've also re-targeted qt-coverage and qt-coverage-2 for devel.

One not-so-nice thing is that, when you build with bzr bd and get a symbol error, it stops after it finds the first problem. This means that, if a symbol change affects *both* libunity-scopes and libunity-scopes-qt, it stops after generating the symbols for libunity-scopes. So, you have to run the script for the first error, commit the symbols file, and the re-start bzr bd, and do the whole thing again to get the diff for the qt symbols.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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 :

Thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
332. By Michi Henning

Removed accidentally-created file.

333. By Michi Henning

Merged parent.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: