aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-24Prune empty/ish call*event.cpp filesAlexey Rusakov
2021-12-24CI: Fix rm being run in the wrong directoryAlexey Rusakov
It's been alright with the comment inside the script.
2021-12-24CI: Move a comment outside of the scriptAlexey Rusakov
Comments inside shell scripts apparently break the flimsy GHA machinery.
2021-12-24CI: Add missing coverage filesAlexey Rusakov
2021-12-24Merge branch 'kitsune/sonar-coverage'Alexey Rusakov
2021-12-24Reinstate update-api jobsAlexey Rusakov
2021-12-24Don't strip lib from names in .gcov filesAlexey Rusakov
That apparently confuses Sonar as it fails to match the source files.
2021-12-24Analyse in 2 threadsAlexey Rusakov
2021-12-24Actually do and submit coverageAlexey Rusakov
...instead of hoping the thing will sort itself out because CLion does.
2021-12-24Merge Sonar invocation back to ci.ymlAlexey Rusakov
For coverage analysis to work, a test run is needed, making the overlap between ci.yaml and sonar.yml quite significant again. Note: 'update-api' option is temporarily dropped from the matrix to speed up the check. If things run fine, 'update-api' will come back.
2021-12-24Sonar: add coverage analysisAlexey Rusakov
2021-12-24Sonar: leave just one jobAlexey Rusakov
There's not much value in analysing the code without E2EE and with E2EE because E2EE is additive; and there's no plan to look close into the generated API code apart from what already ends up being committed.
2021-12-22Merge pull request #526 from quotient-im/kitsune/simpler-event-factoriesAlexey Rusakov
Simplify event factories
2021-12-22StateEventBase: force type to unknown if stateKey is not in JSONAlexey Rusakov
2021-12-22Simplify the code around EventFactory<>Alexey Rusakov
The former code assumed that EventFactory<> is just a class-level shell for a bunch of functions and a static data member that only exists to allow specialisations to occur for the whole group together. On top of that, setupFactory() and registerEventType() strived to protect this group from double registration coming from static variables in an anonymous namespace produced by REGISTER_EVENT_TYPE. The whole thing is now de-static-ed: resolving the factory now relies on class-static Event/RoomEvent/StateEventBase::factory variables instead of factory_t type aliases; and REGISTER_EVENT_TYPE produces non-static inline variables instead, obviating the need of registerEventType/setupFactory kludge.
2021-12-21Don't chain RoomEvent to Event factory any moreAlexey Rusakov
Objects derived from Event are not room events (in the spec sense) and never occur in the same arrays as room events; therefore this chaining has always been superfluous.
2021-12-21Add event_loader.h to CMakeListsAlexey Rusakov
Another forgotten header file.
2021-12-21Quotest: add a missing \n in the outputAlexey Rusakov
2021-12-17RoomMemberEvent: fix an off-by-one errorAlexey Rusakov
Also: extended quotest to cover member renames, not just user profile renames.
2021-12-10Merge pull request #523 from quotient-im/kitsune/ci-add-autotestsAlexey Rusakov
Add autotests to CI
2021-12-09Fix CI failure on macOSAlexey Rusakov
CMAKE_INSTALL_RPATH_USE_LINK_PATH is more universal than setting LD_LIBRARY_PATH Also: drop an extra slash in the path to installed quotest.
2021-12-08Test installed quotestAlexey Rusakov
This covers Quotient_INSTALL_TESTS setting.
2021-12-07CI: Put all build directories to ${{ runner.workspace }}/buildAlexey Rusakov
2021-12-07Fix valgrind invocation failureAlexey Rusakov
It turned out that, confusingly, ${{ runner.workspace }} refers to the directory above $GITHUB_WORKSPACE, which is why the previous commit ended up with valgrind not finding its suppressions.
2021-12-07Fix quotest invocation; use working-directoryAlexey Rusakov
2021-12-06autotests/: don't instantiate QApplicationAlexey Rusakov
Those tests don't even need an event loop.
2021-12-06Add execution of autotests to CIAlexey Rusakov
2021-12-05Drop 'qmc-example' from one last(?) placeAlexey Rusakov
2021-12-03Cleanup; drop an unused RoomAliasesEvent constructorAlexey Rusakov
Also, RoomAliasesEvent is to be completely gone after 0.7.
2021-12-03Add a couple of bare .h files to CMakeLists.txtAlexey Rusakov
These were missing from the commit introducing .h files to sources, highlighting the reason why .h files should be there...
2021-12-03Rely on GTAD 0.9 that calls clang-format itselfAlexey Rusakov
There was that ugly workaround in CMakeLists.txt to produce the list of files to be formatted and making a separate build target for clang-format. As GTAD 0.9 calls clang-format itself this workaround is no more necessary; generate-unformatted-api and format-api build targets are now gone, and clang-format is no more one-build-system-configuration behind GTAD on the list of files to handle.
2021-12-03CMakeLists.txt: add .h files to sourcesAlexey Rusakov
This is driven by the change in the way Qt Creator 6 works with CMake (see https://www.qt.io/blog/qt-creator-6-cmake-update) that basically requires you to explicitly add header files as source files. While this obviously added to the size of the source files list, it also drove dropping the repeated file(GLOB_RECURSE ... CONFIGURE_DEPENDS) call which added a considerable speedbump to the beginning of each build (now that call is just one).
2021-12-02Cleanup on Sonar issuesAlexey Rusakov
2021-12-02Improve function_traits<>; split out from util.*Alexey Rusakov
Quotient::function_traits<> did not support member functions in a proper way (i.e. the way std::invoke_result<> treats them, with the function's owning class represented as the first parameter). Now that I gained the skill and understanding in function_traits<> somewhat wicked machinery, I could properly support member functions. Overloads and generic lambdas are not supported but maybe we'll get to those one day.
2021-12-02visit(Event, ...) -> switchOnType()Alexey Rusakov
It has not much to do with the Visitor design pattern; also, std::visit() has different conventions on the order of parameters.
2021-11-29Track room stubbed state size in logsAlexey Rusakov
2021-11-28Simplify converters.*Alexey Rusakov
There was a lot of excess redirection in fromJson() and toJson() with most of JsonConverter<> specialisations being unnecessary boilerplate. These have been replaced by overloads for toJson() and explicit specialisations for fromJson() wherever possible without breaking the conversion logic.
2021-11-28CMakeLists: drop obsolete -W from the warnings listAlexey Rusakov
Turns out it's been deprecated by -Wextra since before Quotient existed.
2021-11-28Comment on const return types in event.hAlexey Rusakov
Proper linters recognise that the returned types are not primitive, while people might still be confused a bit.
2021-11-28Don't std::move when the callee doesn't support itAlexey Rusakov
In both fixed cases the callee accepts a const reference, which makes std::move() useless. Static analyzers apparently missed them because the cases are inside a macro.
2021-11-28One more small thing to actually fix CI breakageAlexey Rusakov
It's might look weird; but without making fromJson() a specialisation it becomes an overload next to an implicit specialisation of the template function defined just above, and then loses to that specialisation because it (also) has the perfect match. (would be great if the compiler shaded the implicit specialisation in such cases - alas it's not how the standard works.)
2021-11-28Fix CI breakage caused by the previous commitAlexey Rusakov
2021-11-28Event::unsignedPart()Alexey Rusakov
Similar to contentPart() - apparently there are enough places across the code that would benefit from it.
2021-11-27basicEventJson(): dismiss with the templateAlexey Rusakov
Given that QJsonObject only accepts QStrings in the list constructor, the template is useless cruft.
2021-11-27Code cleanupAlexey Rusakov
2021-11-27Event::content() -> contentPart()Alexey Rusakov
There's a clash between Event::content() (a template function) and RoomMessageEvent::content() (plain member). Out of these two, the name more fits to the RME's member function - strictly speaking, Event::content() retrieves a part of content, and so is renamed. In addition, contentPart() defaults to QJsonValue now, which is pretty intuitive (the function returns values from a JSON object) and allows to implement more elaborate logic such as if (const auto v = contentPart<>("key"_ls); v.isObject()) { // foo } else if (v.isString()) { // bar } else { // boo }
2021-11-27Add SonarCloud analysis to CIAlexey Rusakov
2021-11-27Delete ISSUE_TEMPLATE.mdAlexey Rusakov
New issue templates reside under .github/
2021-11-27Add issue templatesAlexey Rusakov
2021-11-27Merge pull request #518 from Smittyvb/room-stateEventsAlexey Rusakov