1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
Commit Graph

87 Commits

Author SHA1 Message Date
Anthony Bilinski
bc751c8e1c
refactor(test): Move mocks into their own library
Avoid re-compiling sources for each test that uses them.
2022-03-02 23:30:04 -08:00
Anthony Bilinski
40846f886c
refactor(test): Deduplicate MockCoreSettings
Also add Mock sources to all tests, to handle tests that require both project
resources and mock without complicating auto_test
2022-03-02 23:30:04 -08:00
sudden6
54e72aa73d
test: add test case for real world Core usage 2022-03-02 23:30:03 -08:00
sudden6
cd8af735fc
fix: don't link emoji resources into targets that don't need them
The emoji resouce file is quite big, so link it only when really needed.
2022-02-25 23:22:28 +01:00
bodwok
0a9e121811
test(FriendListManager): add contact management test 2022-02-17 13:20:58 -08:00
Anthony Bilinski
e1287b94c7
Merge pull request #6413
Mick Sayson (1):
      chore(CI): Use docker for CI scripts
2021-12-31 21:13:46 -08:00
Mick Sayson
8abe8320d2 chore(CI): Use docker for CI scripts
Motiviation:
* Reproducing issues in CI is currently difficult
* Predicting issues in CI is currently difficult if you are not on
  ubuntu 18.04
* Reproducing issues submitted from other distros is currently done by
  creating a VM of that distro and building qtox for it locally
* Documentation for how to build on different distros is out of date
* Issues on non-ubuntu distributions are not caught by CI
* Cross compiling for windows locally is not trivial
* Iterating when working with custom build scripts is slow, scripts
  don't necessarily support re-running without re-starting the docker
  container and re-building qtox again
* Updating dependencies is a pain

Changes:
* docker-compose file has been added to the root of our repo.
  After `docker compose run --rm ubuntu` (or other supported distros),
  you are ready to compile and run qtox
* Dependencies are owned by dependency install scripts in buildscripts/.
  This allows us to use the same exact dependencies in our
  OSX/windows/linux scripts
* New docker images have been added for a variety of distributions.
  These are now run in CI in a variety of configurations
  * Docker images are cached in CI so rebuild time for the majority of
    jobs is quite quick
* Build scripts have been trimmed to leverage state of docker
  containers.
  * Windows build script no longer installs anything, dependencies are
    now managed by the windows_builder docker images
  * Build scripts should now be easily re-runnable. Usage is now `docker
    compose run --rm <image>` and then run the scripts
* All artifacts are now uploaded to github after build, this means we
  can take an appimage/flatpak/exe/dmg for any given PR and try it out
  without having to build it ourselves

Notes:
* Docker image size is quite important. We have a maximum of 5GB cache
  space on github actions. The majority of the linux distro docker
  images cache at ~300-400MB, which gives us room to test ~6 distros
  after accounting for the sizes of flatpak/windows docker images
* Docker layer ordering is relatively intentional. Approximate order
  should be that large dependencies that change infrequently should be
  farther up. This lowers the amount of rebuilding we have to do when
  dependencies are updated
* download_xxx.sh scripts are the cleanest way I could find to implement
  a shared dependency map between osx scripts and docker containers.
  Although it would be nice to have a single dependency mapping file,
  splitting it into individual scripts allows us to only rebuild some
  docker layers when dependencies are updated.
* Github actions are split between docker image building and docker
  image use. This allows us to re-use the same docker images for
  multiple jobs, but only build it once
  * Unfortunately I could not find a way to de-duplicate the stitching
    between jobs, so we have a lot of copy pasta in that area
2021-12-19 14:56:05 -08:00
Mick Sayson
257a19caaa feat(filesform): Add in progress transfers to files form
As part of #1532 it was identified that long running file transfers
could get lost deep in the chatlog. This could result in unexpected use
of bandwidth over time if users lose track of old/large transfers. This
commit updates the files form to show in progress file transfers and
offer a way to control them.

* FilesForm now works on ToxFiles instead of finished file paths
* FilesForm widgets have been replaced with an MV tree view with depth
  1. The existing QListWidget did not provide us the controls to render
  more complex items. The use of delegates allows us to efficiently draw
  progress bars and controls
* getHumanReadableSize has been extracted from FileTransferWidget into a
  more general utils file
2021-12-11 15:38:35 -08:00
Mick Sayson
c7efe320d2 refactor(filetransfer): Move file transfer progress into ToxFile
* Refactor/test ToxFileProgress to ensure that when it's moved it
  behaves well
* Notice problems with speed averaging. We were average speeds without
  keeping track of the times they were over. Adding samples of different
  lengths would result in incorrect speeds. Refactor whole class to correct
* Move ToxFileProgress to be a member of ToxFile
* Remove duplicated members between ToxFile and ToxFileProgress
* Move sample addition into CoreFile
2021-12-11 15:38:35 -08:00
Mick Sayson
b36a38e716
feat(chatlog): Re-implement sliding window ChatLog view
* Replace lines/messages with helper class to synchronize state between
  IChatLog and ChatLog more easily
* selection indexes have been replaced with ChatLine::Ptrs, this is to
  ensure consistency while the view slides around
    * This has another benefit of removing all the code that has to
      manually slide the selection boxes around
* Replaced all insertion/removal functions with single "insertAtIdx".
  This helps ensure that mappings between ChatLogIdx and position within
  the view are captured correctly as items in the view slide around
* workerTimeout replaced with more generic name "renderFinished" that is
  used in synchronous and asynchronous paths
* Removed unused function ChatForm::insertChatMessage
* Re-implemented "Go to current date" with new ChatLog APIs
* Removed unused GenericChatForm::addSystemDateMessage. This is handled
  by ChatLog now
* Resolves #6223
* Resolves #5878
* Resolves #5940
2021-11-21 16:18:44 -08:00
Brandon Mosher
1438f8f766 refactor: Provide a Virtual Method Anchor for Classes in Headers
Define at least one virtual method in polymorphic class cpp files to
improve link efficiency. Do so by defining a defaulted destructor or
another overridden virtual method in the class cpp file.
Also add explicitly defaulted copy/move constructors and assignment
operators to follow the rule of five and to avoid compiler suppression
of these functions due to the addition of a user-provided destructor.
Where neccessary, create new cpp files and add them to CMakeLists and
Testing.cmake. Set the -Wweak-vtables by default when compiling with
clang to issue warnings for new classes that do not comply with this
pattern.

See http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers.

Fixes #6036.
2021-10-26 16:47:40 +00:00
Waris Boonyasiriwat
7a26fe1708 test(persistence): add smileypack unit test
A follow-up of issue #5147, add a unit test which ensures
the same bug won't come up again.
2021-02-20 16:36:11 -08:00
Mick Sayson
7474c6d8ac
feat(messages): Multipacket message support
* Introduced ToxExt and CoreExt abstraction
    * Along with interfaces for mocking and unit testing
* Add "supportedExtensions" concept to Friend
* Dispatch messages to CoreExt instead of Core when friend supports
extended messages
    * Only split messages for core when extended messages are unavailable
* Offline message engine/History not altered. Currently only valid for
an existing session after extension negotiation has completed
2021-01-30 12:52:06 -08:00
powerjungle
90cc962802
feat(logging): check if current code is tagged
This commit adds a new define called "GIT_DESCRIBE_EXACT" through cmake.
It is checked with a regex in "updatecheck.cpp" for a version number after the
check for new updates. If there is no version number,
a warning is output to log.

The reason for the new define is to avoid doing too much regex on
"GET_DESCRIBE", since "GIT_DESCRIBE_EXACT" will not contain a version number if
the code is not tagged.
2020-11-14 12:36:26 +02:00
sudden6
0335f20362
fix: Qt ressource system usage
Make use of the `AUTORCC` feature of cmake to simplify adding resource
files to qTox.

Fixes #6144
2020-07-03 15:45:57 +02:00
Mick Sayson
a9f6543e43
feat(notification): Notification string generator for multiple messages 2020-05-17 00:00:48 -07:00
Mick Sayson
99c1753a76 fix(preview): Fix exif orientations
Previous exif transformations were not valid. The exif spec defines the
orientations as where the 0th row and the 0th column should end. The
previous mappings used in qTox did not respect these mappings and needed
to be updated.
2020-05-16 16:53:14 -07:00
Piraty
e4c7d81ab2 fix(build): make pkg-config verbose about why it fails
Switch from `pkg_search_module` to `pkg_check_modules` to find .pc and
evaluate .pc files of dependencies. Now, in case of any errors, a clear
message is issued about what is wrong, making it obvious what to do.

As of c-toxcore-0.2.11, my system's toxcore.pc file contains this line:
```
Requires.private: libsodium opus vpx
```

Previously, with opus missing, cmake/Dependencies.cmake through an error
about toxcore not being found, but never actually told why (also it was
misleading, because opus was missing, not toxcore).

Before:
```
<...>
-- Checking for one of the modules 'toxcore'
-- TOXCORE not found
-- Checking for one of the modules 'toxav'
-- TOXAV not found
<...>
```

After:
```
<...>
-- Checking for module 'toxcore'
--   Package 'opus', required by 'toxcore', not found
-- TOXCORE not found
-- Checking for module 'toxav'
--   No package 'toxav' found
-- TOXAV not found
<...>
```
2020-04-03 19:53:24 +02:00
Anthony Bilinski
cf672375be
revert(toxme): remove toxme from qTox - the service is offline permanently
As of 2019-10-09, toxme.io was taken offline permanently. Remove UI and code
in qTox relating to it. Revert this commit if it comes back online in the
future.

Fix #5897
2020-01-16 13:28:41 -08:00
jenli669
04a9bc46f4
docs(copyright): update and add copyright info
zealously updates and adds qTox copyright information.

Fixes #5713
2019-06-28 01:18:26 +02:00
Mick Sayson
71f8220925 refactor(chatlog): Add class to manage underlying chatlog state 2019-06-21 11:01:35 -07:00
Mick Sayson
f0d840002a refactor(messages): Create class to manage sending/receiving group messages from core 2019-06-21 11:01:10 -07:00
Mick Sayson
22a4c38bfd refactor(messages): Create class to manage sending/receiving friend messages from core 2019-06-21 11:01:10 -07:00
Mick Sayson
e5016337bb refactor(offlinemsg): Decouple OfflineMsgEngine from other components 2019-05-26 15:33:51 -07:00
Anthony Bilinski
316893ace9
test(db): add db schema upgrade test 2019-05-15 13:26:21 -07:00
Anthony Bilinski
97d05f9d67
refactor(id): make ContactId interface, implement GroupId
Precursor for group history, friend blocking
2019-04-13 12:58:25 -07:00
yangfl
70781bb14f chore(cmake): add libatomic to target_link_libraries when required
Looks like CMAKE_REQUIRED_LIBRARIES are not automatically linked against.
2019-03-28 18:18:49 +08:00
sudden6
66e2c01029
feat(notify): add desktop notifications using snorenotify
This commit adds very basic support for desktop notifications on friend
request, group invites, friend messages and group messages.
2019-03-24 11:58:09 +01:00
Patrick
cf32ccfa0e test(core): Add test cases for core, initial 2019-03-17 13:52:42 +01:00
sudden6
489027ea1e
fix(flatpak): use SVG for icon
Flatpak doesn't allow compressed SVGs as icons because this is against
the specification.
2019-02-09 12:02:56 +01:00
Anthony Bilinski
013771c13a
feat(build): remove timestamps from build to allow reproducible builds
avoid Qt embedding timestamps into translations after copying .ts to .qm to work towards reproducible builds. Now reproducible locally as long as there is absolutely no change to environment.
2019-01-28 23:53:33 -08:00
yangfl
ec9d9850bf chore(cmake): add missing CheckLibraryExists in CheckAtomic.cmake 2018-11-21 20:13:13 +08:00
sudden6
793d744705
test: add simple testcase for BoostrapNodeUpdater
This test just tries to connect to nodes.tox.chat and retrieve nodes.
The result is not checked yet.
2018-11-19 17:16:23 +01:00
yangfl
57fba65a37 chore(cmake): check for libatomic support
Sometimes linking against libatomic is required for atomic ops, if
the platform doesn't support lock-free atomics.

Source: https://github.com/llvm-mirror/llvm/blob/master/cmake/modules/CheckAtomic.cmake
2018-11-18 23:23:29 +08:00
sudden6
55c361eb71
test(paths): add tests for paths module 2018-11-14 11:02:20 +01:00
Patrick
ad6d60d1ab
test(toxstring): Add test cases for toxstring.h 2018-10-07 13:51:33 +02:00
Diadlo
671b9456a8
feat: Add spell checking
Fix #1301

Spell checking implemented by KF5Sonnet
2018-07-19 20:31:52 +02:00
sudden6
8b4240776c
chore(install): rename .desktop and .appdata.xml
The xdg-desktop specification strongly recommends to use a reverse
domain name, so follow that.
2018-05-13 22:09:58 +02:00
Robert-André Mauchin
5db0bdd381 fix(build): move Appdata file installation to /usr/share/metainfo 2018-02-16 18:48:13 +01:00
Maxim Biro
3f0372b2c5 chore(cmake): Lookup toxcore's static dependencies 2018-02-02 03:58:04 -05:00
iphydf
398ba415ce
chore: Update to immutable TES API and one-big-lib change. 2018-01-14 15:47:43 +00:00
sudden6
7ad68e2f43
fix(cmake): fix platform extensions for windows
fixes #4860
2017-12-12 22:06:57 +01:00
sudden6
a3a361b0eb
Merge pull request #4847
anthony.bilinski (1):
      fix(install): Fix gzip invalid usage
2017-12-02 11:27:51 +01:00
anthony.bilinski
266f63f6df fix(install): Fix gzip invalid usage 2017-11-30 11:15:04 -08:00
ezavod
423f095622
fix(cmake): add missing dependency
Requires `Qt5Concurrent` to be installed when running cmake.
This is needed by `coreav.cpp`.
2017-11-29 19:43:22 +01:00
Diadlo
ebe6326cdd
chore(cmake): Add gzip svg icon on install
Fix #4582
2017-10-27 20:54:08 +03:00
Maxim Biro
21af6875cc feat(travis): run tests on Windows 2017-10-25 01:48:18 -04:00
Vincas Dargis
d69023c9d7 fix(build): do not build unix-specific test on Windows
Modify CMake file to build posixsignalnotifier test only on
UNIX-like systems.
2017-10-14 19:33:16 +03:00
Diadlo
d3babb3fbe
test(toxmedata): Add test for toxmedata class 2017-10-13 14:56:15 +03:00
Diadlo
42c4a74826
test: Add tests for PosixSignalNotifier 2017-10-11 14:50:09 +03:00