From e123ea4a820799e5aaa8df1823cdeee4c3964e98 Mon Sep 17 00:00:00 2001 From: Bionus Date: Wed, 11 Jan 2023 01:53:41 +0100 Subject: [PATCH] chore: move lib tests to src/lib/tests --- .github/workflows/build.yml | 6 ++-- .gitignore | 20 ++++++------- src/cli/tests/CMakeLists.txt | 4 +-- src/crash-reporter/tests/CMakeLists.txt | 4 +-- src/gui/tests/CMakeLists.txt | 4 +-- src/lib/CMakeLists.txt | 3 ++ src/lib/tests/CMakeLists.txt | 27 ++++++++++++++++++ src/{ => lib}/tests/languages/CMakeLists.txt | 0 src/{ => lib}/tests/languages/English.ts | 0 src/{ => lib}/tests/languages/French.ts | 0 src/{ => lib}/tests/resources/image_1x1.png | Bin .../tests/resources/image_200x200.png | Bin .../tests/resources/languages/English.qm | Bin .../tests/resources/languages/French.qm | Bin .../tests/resources/languages/languages.ini | 0 .../tests/resources/languages/qt/English.qm | Bin .../tests/resources/languages/qt/French.qm | Bin src/{ => lib}/tests/resources/minimal/bmp.bmp | Bin src/{ => lib}/tests/resources/minimal/gif.gif | Bin src/{ => lib}/tests/resources/minimal/ico.ico | Bin src/{ => lib}/tests/resources/minimal/jpg.jpg | Bin src/{ => lib}/tests/resources/minimal/mp4.mp4 | Bin src/{ => lib}/tests/resources/minimal/png.png | Bin src/{ => lib}/tests/resources/minimal/swf.swf | Bin src/{ => lib}/tests/resources/minimal/txt.txt | 0 .../tests/resources/minimal/webm.webm | Bin .../tests/resources/oauth2/no_token_type.json | 0 src/{ => lib}/tests/resources/oauth2/ok.json | 0 .../resources/oauth2/ok_in_response.json | 0 .../resources/oauth2/wrong_token_type.json | 0 .../resources/pages/behoimi.org/homepage.html | 0 .../resources/pages/behoimi.org/results.html | 0 .../resources/pages/behoimi.org/results.json | 0 .../resources/pages/behoimi.org/results.xml | 0 .../resources/pages/behoimi.org/tags.html | 0 .../resources/pages/behoimi.org/tags.json | 0 .../resources/pages/behoimi.org/tags.xml | 0 .../47a890d045ebe564e816a774814ae2f6.json | 0 .../aeb54553c54f6d4b3ddaf297b7b01fd7.html | 0 .../pages/danbooru.donmai.us/homepage.html | 0 .../pages/danbooru.donmai.us/login.html | 0 .../danbooru.donmai.us/pack-loader-1-1.xml | 0 .../danbooru.donmai.us/pack-loader-1-2.xml | 0 .../danbooru.donmai.us/pack-loader-1-3.xml | 0 .../danbooru.donmai.us/pack-loader-2-1.xml | 0 .../danbooru.donmai.us/pack-loader-2-2.xml | 0 .../danbooru.donmai.us/pack-loader-2-3.xml | 0 .../danbooru.donmai.us/pack-loader-2-4.xml | 0 .../danbooru.donmai.us/pack-loader-2-5.xml | 0 .../danbooru.donmai.us/pack-loader-2-6.xml | 0 .../danbooru.donmai.us/pack-loader-2-7.xml | 0 .../danbooru.donmai.us/pack-loader-2-8.xml | 0 .../danbooru.donmai.us/pack-loader-20-1.xml | 0 .../pages/danbooru.donmai.us/results.html | 0 .../pages/danbooru.donmai.us/results.xml | 0 .../pages/danbooru.donmai.us/tags.html | 0 .../pages/danbooru.donmai.us/tags.json | 0 .../pages/danbooru.donmai.us/tags.xml | 0 .../pages/derpibooru.org/results.html | 0 .../pages/derpibooru.org/results.json | 0 .../resources/pages/derpibooru.org/tags.html | 0 .../resources/pages/derpibooru.org/tags.json | 0 .../e-hentai.org/pack-loader-gallery-1-1.html | 0 .../e-hentai.org/pack-loader-gallery-2-1.html | 0 .../e-hentai.org/pack-loader-gallery-3-1.html | 0 .../pages/e-hentai.org/pack-loader-list.html | 0 .../resources/pages/e621.net/results.html | 0 .../resources/pages/e621.net/results.json | 0 .../tests/resources/pages/e621.net/tags.html | 0 .../tests/resources/pages/e621.net/tags.json | 0 .../pages/gelbooru.com/pack-loader-1.html | 0 .../pages/gelbooru.com/pack-loader-2.html | 0 .../pages/gelbooru.com/pack-loader-3.html | 0 .../pages/gelbooru.com/pack-loader-4.html | 0 .../pages/gelbooru.com/pack-loader-5.html | 0 .../pages/gelbooru.com/pack-loader-6.html | 0 .../pages/gelbooru.com/pack-loader-7.html | 0 .../resources/pages/gelbooru.com/results.html | 0 .../resources/pages/gelbooru.com/results.xml | 0 .../resources/pages/gelbooru.com/tags.html | 0 .../results-animated.html | 0 .../idol.sankakucomplex.com/results.html | 0 .../idol.sankakucomplex.com/results.json | 0 .../01724e365aa7000ecfa0fd8ae19cb9cf.xml | 0 .../68eca83cc435e3fa27a1324e60fb41b8.xml | 0 .../resources/pages/rm.booru.org/results.html | 0 .../pages/www.zerochan.net/results.html | 0 .../pages/www.zerochan.net/results.rss | 0 .../tests/resources/recurse/test.txt | 0 .../tests/resources/recurse/test/test1.txt | 0 .../tests/resources/recurse/test/test2.txt | 0 .../danbooru.donmai.us/tag-types.txt | 0 .../sites/Danbooru/behoimi.org/tag-types.txt | 0 .../sites/Danbooru/e621.net/tag-types.txt | 0 .../tests/resources/sites/Danbooru/sites.txt | 0 src/{ => lib}/tests/resources/tag-types.txt | 0 src/{ => lib}/tests/resources/你好.txt | 0 .../tests/src/auth/auth-field-test.cpp | 0 src/{ => lib}/tests/src/auth/auth-test.cpp | 0 .../tests/src/commands/sql-worker-test.cpp | 0 .../tests/src/concurrent-multi-queue-test.cpp | 0 .../src/downloader/batch-downloader-test.cpp | 0 .../downloader/download-query-group-test.cpp | 0 .../downloader/download-query-image-test.cpp | 0 .../src/downloader/extension-rotator-test.cpp | 0 .../src/downloader/file-downloader-test.cpp | 2 +- .../src/downloader/image-downloader-test.cpp | 4 +-- .../src/downloader/image-save-result-test.cpp | 0 .../src/exponential-moving-average-test.cpp | 0 .../filename/conditional-filename-test.cpp | 0 .../filename-condition-visitor-test.cpp | 0 .../filename-execution-visitor-test.cpp | 0 .../src/filename/filename-parser-test.cpp | 0 .../filename/filename-print-visitor-test.cpp | 0 .../filename-resolution-visitor-test.cpp | 0 .../tests/src/filename/filename-test.cpp | 0 src/{ => lib}/tests/src/functions-test.cpp | 0 .../tests/src/integration/behoimi-test.cpp | 0 .../tests/src/integration/booru-org-test.cpp | 0 .../tests/src/integration/danbooru-test.cpp | 0 .../tests/src/integration/derpibooru-test.cpp | 0 .../tests/src/integration/e621-test.cpp | 0 .../tests/src/integration/gelbooru-test.cpp | 0 .../src/integration/integration-helpers.cpp | 0 .../src/integration/integration-helpers.h | 0 .../tests/src/integration/sankaku-test.cpp | 0 .../tests/src/integration/zerochan-test.cpp | 0 .../tests/src/language-loader-test.cpp | 0 .../tests/src/loader/pack-loader-test.cpp | 0 src/{ => lib}/tests/src/loader/token-test.cpp | 0 .../tests/src/login/http-login-test.cpp | 0 .../tests/src/login/oauth2-login-test.cpp | 0 .../tests/src/login/url-login-test.cpp | 0 .../tests/src/mixed-settings-test.cpp | 0 .../tests/src/models/favorite-test.cpp | 0 .../src/models/filtering/blacklist-test.cpp | 0 .../src/models/filtering/meta-filter-test.cpp | 0 .../src/models/filtering/post-filter-test.cpp | 0 .../src/models/filtering/tag-filter-test.cpp | 0 .../models/filtering/token-filter-test.cpp | 0 .../tests/src/models/image-size-test.cpp | 0 src/{ => lib}/tests/src/models/image-test.cpp | 0 .../md5-database/md5-database-sqlite-test.cpp | 0 .../md5-database/md5-database-text-test.cpp | 0 .../tests/src/models/page-api-test.cpp | 0 src/{ => lib}/tests/src/models/page-test.cpp | 0 src/{ => lib}/tests/src/models/pool-test.cpp | 0 .../tests/src/models/profile-test.cpp | 0 src/{ => lib}/tests/src/models/site-test.cpp | 0 .../tests/src/models/source-guesser-test.cpp | 0 .../tests/src/models/source-test.cpp | 0 .../tests/src/monitoring/monitor-test.cpp | 0 .../tests/src/network-manager-test.cpp | 0 .../src/search/search-format-visitor-test.cpp | 0 src/{ => lib}/tests/src/tags/tag-api-test.cpp | 0 .../src/tags/tag-database-in-memory-test.cpp | 0 .../src/tags/tag-database-sqlite-test.cpp | 0 .../tests/src/tags/tag-name-format-test.cpp | 0 .../tests/src/tags/tag-name-test.cpp | 0 .../tests/src/tags/tag-stylist-test.cpp | 0 src/{ => lib}/tests/src/tags/tag-test.cpp | 0 .../tests/src/tags/tag-type-api-test.cpp | 0 .../tests/src/tags/tag-type-database-test.cpp | 0 .../tests/src/updater/source-updater-test.cpp | 0 .../tests/src/updater/updater-test.cpp | 0 .../tests/src/utils/file-utils-test.cpp | 0 .../tests/src/utils/html-node-test.cpp | 0 src/{ => lib}/tests/src/utils/logging.cpp | 0 src/{ => lib}/tests/src/utils/zip-test.cpp | 0 src/tests/CMakeLists.txt | 22 -------------- src/tests/src/{common => }/catch.h | 0 src/tests/src/{common => }/main.cpp | 0 src/tests/src/{common => }/raii-helpers.h | 0 src/tests/src/{common => }/source-helpers.cpp | 14 ++++----- src/tests/src/{common => }/source-helpers.h | 0 175 files changed, 59 insertions(+), 51 deletions(-) create mode 100644 src/lib/tests/CMakeLists.txt rename src/{ => lib}/tests/languages/CMakeLists.txt (100%) rename src/{ => lib}/tests/languages/English.ts (100%) rename src/{ => lib}/tests/languages/French.ts (100%) rename src/{ => lib}/tests/resources/image_1x1.png (100%) rename src/{ => lib}/tests/resources/image_200x200.png (100%) rename src/{ => lib}/tests/resources/languages/English.qm (100%) rename src/{ => lib}/tests/resources/languages/French.qm (100%) rename src/{ => lib}/tests/resources/languages/languages.ini (100%) rename src/{ => lib}/tests/resources/languages/qt/English.qm (100%) rename src/{ => lib}/tests/resources/languages/qt/French.qm (100%) rename src/{ => lib}/tests/resources/minimal/bmp.bmp (100%) rename src/{ => lib}/tests/resources/minimal/gif.gif (100%) rename src/{ => lib}/tests/resources/minimal/ico.ico (100%) rename src/{ => lib}/tests/resources/minimal/jpg.jpg (100%) rename src/{ => lib}/tests/resources/minimal/mp4.mp4 (100%) rename src/{ => lib}/tests/resources/minimal/png.png (100%) rename src/{ => lib}/tests/resources/minimal/swf.swf (100%) rename src/{ => lib}/tests/resources/minimal/txt.txt (100%) rename src/{ => lib}/tests/resources/minimal/webm.webm (100%) rename src/{ => lib}/tests/resources/oauth2/no_token_type.json (100%) rename src/{ => lib}/tests/resources/oauth2/ok.json (100%) rename src/{ => lib}/tests/resources/oauth2/ok_in_response.json (100%) rename src/{ => lib}/tests/resources/oauth2/wrong_token_type.json (100%) rename src/{ => lib}/tests/resources/pages/behoimi.org/homepage.html (100%) rename src/{ => lib}/tests/resources/pages/behoimi.org/results.html (100%) rename src/{ => lib}/tests/resources/pages/behoimi.org/results.json (100%) rename src/{ => lib}/tests/resources/pages/behoimi.org/results.xml (100%) rename src/{ => lib}/tests/resources/pages/behoimi.org/tags.html (100%) rename src/{ => lib}/tests/resources/pages/behoimi.org/tags.json (100%) rename src/{ => lib}/tests/resources/pages/behoimi.org/tags.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/47a890d045ebe564e816a774814ae2f6.json (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/aeb54553c54f6d4b3ddaf297b7b01fd7.html (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/homepage.html (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/login.html (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-1-1.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-1-2.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-1-3.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-1.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-2.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-3.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-4.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-5.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-6.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-7.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-2-8.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/pack-loader-20-1.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/results.html (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/results.xml (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/tags.html (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/tags.json (100%) rename src/{ => lib}/tests/resources/pages/danbooru.donmai.us/tags.xml (100%) rename src/{ => lib}/tests/resources/pages/derpibooru.org/results.html (100%) rename src/{ => lib}/tests/resources/pages/derpibooru.org/results.json (100%) rename src/{ => lib}/tests/resources/pages/derpibooru.org/tags.html (100%) rename src/{ => lib}/tests/resources/pages/derpibooru.org/tags.json (100%) rename src/{ => lib}/tests/resources/pages/e-hentai.org/pack-loader-gallery-1-1.html (100%) rename src/{ => lib}/tests/resources/pages/e-hentai.org/pack-loader-gallery-2-1.html (100%) rename src/{ => lib}/tests/resources/pages/e-hentai.org/pack-loader-gallery-3-1.html (100%) rename src/{ => lib}/tests/resources/pages/e-hentai.org/pack-loader-list.html (100%) rename src/{ => lib}/tests/resources/pages/e621.net/results.html (100%) rename src/{ => lib}/tests/resources/pages/e621.net/results.json (100%) rename src/{ => lib}/tests/resources/pages/e621.net/tags.html (100%) rename src/{ => lib}/tests/resources/pages/e621.net/tags.json (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/pack-loader-1.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/pack-loader-2.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/pack-loader-3.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/pack-loader-4.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/pack-loader-5.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/pack-loader-6.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/pack-loader-7.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/results.html (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/results.xml (100%) rename src/{ => lib}/tests/resources/pages/gelbooru.com/tags.html (100%) rename src/{ => lib}/tests/resources/pages/idol.sankakucomplex.com/results-animated.html (100%) rename src/{ => lib}/tests/resources/pages/idol.sankakucomplex.com/results.html (100%) rename src/{ => lib}/tests/resources/pages/idol.sankakucomplex.com/results.json (100%) rename src/{ => lib}/tests/resources/pages/raw.githubusercontent.com/01724e365aa7000ecfa0fd8ae19cb9cf.xml (100%) rename src/{ => lib}/tests/resources/pages/raw.githubusercontent.com/68eca83cc435e3fa27a1324e60fb41b8.xml (100%) rename src/{ => lib}/tests/resources/pages/rm.booru.org/results.html (100%) rename src/{ => lib}/tests/resources/pages/www.zerochan.net/results.html (100%) rename src/{ => lib}/tests/resources/pages/www.zerochan.net/results.rss (100%) rename src/{ => lib}/tests/resources/recurse/test.txt (100%) rename src/{ => lib}/tests/resources/recurse/test/test1.txt (100%) rename src/{ => lib}/tests/resources/recurse/test/test2.txt (100%) rename src/{ => lib}/tests/resources/sites/Danbooru (2.0)/danbooru.donmai.us/tag-types.txt (100%) rename src/{ => lib}/tests/resources/sites/Danbooru/behoimi.org/tag-types.txt (100%) rename src/{ => lib}/tests/resources/sites/Danbooru/e621.net/tag-types.txt (100%) rename src/{ => lib}/tests/resources/sites/Danbooru/sites.txt (100%) rename src/{ => lib}/tests/resources/tag-types.txt (100%) rename src/{ => lib}/tests/resources/你好.txt (100%) rename src/{ => lib}/tests/src/auth/auth-field-test.cpp (100%) rename src/{ => lib}/tests/src/auth/auth-test.cpp (100%) rename src/{ => lib}/tests/src/commands/sql-worker-test.cpp (100%) rename src/{ => lib}/tests/src/concurrent-multi-queue-test.cpp (100%) rename src/{ => lib}/tests/src/downloader/batch-downloader-test.cpp (100%) rename src/{ => lib}/tests/src/downloader/download-query-group-test.cpp (100%) rename src/{ => lib}/tests/src/downloader/download-query-image-test.cpp (100%) rename src/{ => lib}/tests/src/downloader/extension-rotator-test.cpp (100%) rename src/{ => lib}/tests/src/downloader/file-downloader-test.cpp (97%) rename src/{ => lib}/tests/src/downloader/image-downloader-test.cpp (98%) rename src/{ => lib}/tests/src/downloader/image-save-result-test.cpp (100%) rename src/{ => lib}/tests/src/exponential-moving-average-test.cpp (100%) rename src/{ => lib}/tests/src/filename/conditional-filename-test.cpp (100%) rename src/{ => lib}/tests/src/filename/filename-condition-visitor-test.cpp (100%) rename src/{ => lib}/tests/src/filename/filename-execution-visitor-test.cpp (100%) rename src/{ => lib}/tests/src/filename/filename-parser-test.cpp (100%) rename src/{ => lib}/tests/src/filename/filename-print-visitor-test.cpp (100%) rename src/{ => lib}/tests/src/filename/filename-resolution-visitor-test.cpp (100%) rename src/{ => lib}/tests/src/filename/filename-test.cpp (100%) rename src/{ => lib}/tests/src/functions-test.cpp (100%) rename src/{ => lib}/tests/src/integration/behoimi-test.cpp (100%) rename src/{ => lib}/tests/src/integration/booru-org-test.cpp (100%) rename src/{ => lib}/tests/src/integration/danbooru-test.cpp (100%) rename src/{ => lib}/tests/src/integration/derpibooru-test.cpp (100%) rename src/{ => lib}/tests/src/integration/e621-test.cpp (100%) rename src/{ => lib}/tests/src/integration/gelbooru-test.cpp (100%) rename src/{ => lib}/tests/src/integration/integration-helpers.cpp (100%) rename src/{ => lib}/tests/src/integration/integration-helpers.h (100%) rename src/{ => lib}/tests/src/integration/sankaku-test.cpp (100%) rename src/{ => lib}/tests/src/integration/zerochan-test.cpp (100%) rename src/{ => lib}/tests/src/language-loader-test.cpp (100%) rename src/{ => lib}/tests/src/loader/pack-loader-test.cpp (100%) rename src/{ => lib}/tests/src/loader/token-test.cpp (100%) rename src/{ => lib}/tests/src/login/http-login-test.cpp (100%) rename src/{ => lib}/tests/src/login/oauth2-login-test.cpp (100%) rename src/{ => lib}/tests/src/login/url-login-test.cpp (100%) rename src/{ => lib}/tests/src/mixed-settings-test.cpp (100%) rename src/{ => lib}/tests/src/models/favorite-test.cpp (100%) rename src/{ => lib}/tests/src/models/filtering/blacklist-test.cpp (100%) rename src/{ => lib}/tests/src/models/filtering/meta-filter-test.cpp (100%) rename src/{ => lib}/tests/src/models/filtering/post-filter-test.cpp (100%) rename src/{ => lib}/tests/src/models/filtering/tag-filter-test.cpp (100%) rename src/{ => lib}/tests/src/models/filtering/token-filter-test.cpp (100%) rename src/{ => lib}/tests/src/models/image-size-test.cpp (100%) rename src/{ => lib}/tests/src/models/image-test.cpp (100%) rename src/{ => lib}/tests/src/models/md5-database/md5-database-sqlite-test.cpp (100%) rename src/{ => lib}/tests/src/models/md5-database/md5-database-text-test.cpp (100%) rename src/{ => lib}/tests/src/models/page-api-test.cpp (100%) rename src/{ => lib}/tests/src/models/page-test.cpp (100%) rename src/{ => lib}/tests/src/models/pool-test.cpp (100%) rename src/{ => lib}/tests/src/models/profile-test.cpp (100%) rename src/{ => lib}/tests/src/models/site-test.cpp (100%) rename src/{ => lib}/tests/src/models/source-guesser-test.cpp (100%) rename src/{ => lib}/tests/src/models/source-test.cpp (100%) rename src/{ => lib}/tests/src/monitoring/monitor-test.cpp (100%) rename src/{ => lib}/tests/src/network-manager-test.cpp (100%) rename src/{ => lib}/tests/src/search/search-format-visitor-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-api-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-database-in-memory-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-database-sqlite-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-name-format-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-name-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-stylist-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-type-api-test.cpp (100%) rename src/{ => lib}/tests/src/tags/tag-type-database-test.cpp (100%) rename src/{ => lib}/tests/src/updater/source-updater-test.cpp (100%) rename src/{ => lib}/tests/src/updater/updater-test.cpp (100%) rename src/{ => lib}/tests/src/utils/file-utils-test.cpp (100%) rename src/{ => lib}/tests/src/utils/html-node-test.cpp (100%) rename src/{ => lib}/tests/src/utils/logging.cpp (100%) rename src/{ => lib}/tests/src/utils/zip-test.cpp (100%) rename src/tests/src/{common => }/catch.h (100%) rename src/tests/src/{common => }/main.cpp (100%) rename src/tests/src/{common => }/raii-helpers.h (100%) rename src/tests/src/{common => }/source-helpers.cpp (61%) rename src/tests/src/{common => }/source-helpers.h (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b78b6444..52f5002e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,7 +118,7 @@ jobs: with: working-directory: src run: | - ../build/tests/tests + ../build/lib/tests/lib-tests ../build/cli/tests/cli-tests - name: Test GUI @@ -239,7 +239,7 @@ jobs: with: working-directory: src run: | - ../build/tests/tests + ../build/lib/tests/lib-tests ../build/cli/tests/cli-tests - name: Test GUI @@ -343,7 +343,7 @@ jobs: - name: Test working-directory: src run: | - ../build/tests/tests + ../build/lib/tests/lib-tests ../build/cli/tests/cli-tests - name: Test GUI diff --git a/.gitignore b/.gitignore index bcfceee0..8ac92ec1 100755 --- a/.gitignore +++ b/.gitignore @@ -8,16 +8,16 @@ src/sites/*/*/cookies.txt src/sites/*/*/settings.ini src/sites/*/*/tags.txt src/sites/*/*/tags.db -src/tests/resources/tags.txt -src/tests/resources/tags.db -src/tests/resources/md5s.txt -src/tests/resources/settings.ini -src/tests/resources/settings.ini.* -src/tests/resources/*.txt -src/tests/resources/favorites.* -src/tests/resources/thumbs/ -src/tests/resources/tmp/ -src/tests/resources/sites/ +src/lib/tests/resources/tags.txt +src/lib/tests/resources/tags.db +src/lib/tests/resources/md5s.txt +src/lib/tests/resources/settings.ini +src/lib/tests/resources/settings.ini.* +src/lib/tests/resources/*.txt +src/lib/tests/resources/favorites.* +src/lib/tests/resources/thumbs/ +src/lib/tests/resources/tmp/ +src/lib/tests/resources/sites/ /test_* target_wrapper.bat symbols/ diff --git a/src/cli/tests/CMakeLists.txt b/src/cli/tests/CMakeLists.txt index 2431b2f7..56cb4485 100644 --- a/src/cli/tests/CMakeLists.txt +++ b/src/cli/tests/CMakeLists.txt @@ -14,8 +14,8 @@ list(APPEND QT_LIBRARIES Qt5::Test Qt5::Widgets) # Sources include(ListFilterRegex) listFilterRegex(SOURCES "main.cpp") -file(GLOB_RECURSE SOURCES_TESTS "./*.cpp" "../../tests/src/common/*.cpp") -include_directories(${PROJECT_NAME} PUBLIC "." "../../tests/" "../../tests/src/" "../../tests/src/common/") +file(GLOB_RECURSE SOURCES_TESTS "./*.cpp" "../../tests/src/*.cpp") +include_directories(${PROJECT_NAME} PUBLIC "." "../../tests/" "../../tests/src/") # Executable add_executable(${PROJECT_NAME} ${SOURCES} ${FORMS} ${UTILS_SOURCES} ${SOURCES_TESTS}) diff --git a/src/crash-reporter/tests/CMakeLists.txt b/src/crash-reporter/tests/CMakeLists.txt index f4fcf632..523cb327 100644 --- a/src/crash-reporter/tests/CMakeLists.txt +++ b/src/crash-reporter/tests/CMakeLists.txt @@ -7,8 +7,8 @@ add_definitions(-DTEST=1) # Sources include(ListFilterRegex) listFilterRegex(SOURCES "main.cpp") -file(GLOB_RECURSE SOURCES_TESTS "./*.cpp" "../../tests/src/common/*.cpp") -include_directories(${PROJECT_NAME} PUBLIC "." "../../lib/src/" "../../tests/" "../../tests/src/" "../../tests/src/common/") +file(GLOB_RECURSE SOURCES_TESTS "./*.cpp" "../../tests/src/*.cpp") +include_directories(${PROJECT_NAME} PUBLIC "." "../../lib/src/" "../../tests/" "../../tests/src/") # Executable add_executable(${PROJECT_NAME} ${SOURCES} ${FORMS} ${UTILS_SOURCES} ${SOURCES_TESTS}) diff --git a/src/gui/tests/CMakeLists.txt b/src/gui/tests/CMakeLists.txt index 24f21102..91ff1d67 100644 --- a/src/gui/tests/CMakeLists.txt +++ b/src/gui/tests/CMakeLists.txt @@ -10,8 +10,8 @@ endif() # Sources include(ListFilterRegex) listFilterRegex(SOURCES "main.cpp") -file(GLOB_RECURSE SOURCES_TESTS "./*.cpp" "../../tests/src/common/*.cpp") -include_directories(${PROJECT_NAME} PUBLIC "." "../../tests/" "../../tests/src/" "../../tests/src/common/") +file(GLOB_RECURSE SOURCES_TESTS "./*.cpp" "../../tests/src/*.cpp") +include_directories(${PROJECT_NAME} PUBLIC "." "../../tests/" "../../tests/src/" "../../tests/src/") # Executable add_executable(${PROJECT_NAME} ${SOURCES} ${FORMS} ${UTILS_SOURCES} ${SOURCES_TESTS}) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 1ff87250..47ca5d59 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -33,3 +33,6 @@ target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${LIBS}) if(USE_PCH) cotire(${PROJECT_NAME}) endif() + +# Tests +add_subdirectory(tests) diff --git a/src/lib/tests/CMakeLists.txt b/src/lib/tests/CMakeLists.txt new file mode 100644 index 00000000..9752666f --- /dev/null +++ b/src/lib/tests/CMakeLists.txt @@ -0,0 +1,27 @@ +project(lib-tests) + +# General +enable_testing() +add_definitions(-DTEST=1) +if(DEFINED HEADLESS) + add_definitions(-DHEADLESS=1) +endif() + +find_package(Qt5 COMPONENTS Gui Test Widgets REQUIRED) +set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Test Qt5::Widgets) + +# Sources +file(GLOB_RECURSE SOURCES "src/*.cpp" "../../tests/src/*.cpp") +include_directories("src/" "." "../src/" "../vendor/lexbor/source/" "../../tests/" "../../tests/src/") + +# Executable +add_executable(${PROJECT_NAME} ${SOURCES}) +add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} lib Catch2::Catch2) + +add_subdirectory(languages) + +# Pre-compiled header +if(USE_PCH) + cotire(${PROJECT_NAME}) +endif() diff --git a/src/tests/languages/CMakeLists.txt b/src/lib/tests/languages/CMakeLists.txt similarity index 100% rename from src/tests/languages/CMakeLists.txt rename to src/lib/tests/languages/CMakeLists.txt diff --git a/src/tests/languages/English.ts b/src/lib/tests/languages/English.ts similarity index 100% rename from src/tests/languages/English.ts rename to src/lib/tests/languages/English.ts diff --git a/src/tests/languages/French.ts b/src/lib/tests/languages/French.ts similarity index 100% rename from src/tests/languages/French.ts rename to src/lib/tests/languages/French.ts diff --git a/src/tests/resources/image_1x1.png b/src/lib/tests/resources/image_1x1.png similarity index 100% rename from src/tests/resources/image_1x1.png rename to src/lib/tests/resources/image_1x1.png diff --git a/src/tests/resources/image_200x200.png b/src/lib/tests/resources/image_200x200.png similarity index 100% rename from src/tests/resources/image_200x200.png rename to src/lib/tests/resources/image_200x200.png diff --git a/src/tests/resources/languages/English.qm b/src/lib/tests/resources/languages/English.qm similarity index 100% rename from src/tests/resources/languages/English.qm rename to src/lib/tests/resources/languages/English.qm diff --git a/src/tests/resources/languages/French.qm b/src/lib/tests/resources/languages/French.qm similarity index 100% rename from src/tests/resources/languages/French.qm rename to src/lib/tests/resources/languages/French.qm diff --git a/src/tests/resources/languages/languages.ini b/src/lib/tests/resources/languages/languages.ini similarity index 100% rename from src/tests/resources/languages/languages.ini rename to src/lib/tests/resources/languages/languages.ini diff --git a/src/tests/resources/languages/qt/English.qm b/src/lib/tests/resources/languages/qt/English.qm similarity index 100% rename from src/tests/resources/languages/qt/English.qm rename to src/lib/tests/resources/languages/qt/English.qm diff --git a/src/tests/resources/languages/qt/French.qm b/src/lib/tests/resources/languages/qt/French.qm similarity index 100% rename from src/tests/resources/languages/qt/French.qm rename to src/lib/tests/resources/languages/qt/French.qm diff --git a/src/tests/resources/minimal/bmp.bmp b/src/lib/tests/resources/minimal/bmp.bmp similarity index 100% rename from src/tests/resources/minimal/bmp.bmp rename to src/lib/tests/resources/minimal/bmp.bmp diff --git a/src/tests/resources/minimal/gif.gif b/src/lib/tests/resources/minimal/gif.gif similarity index 100% rename from src/tests/resources/minimal/gif.gif rename to src/lib/tests/resources/minimal/gif.gif diff --git a/src/tests/resources/minimal/ico.ico b/src/lib/tests/resources/minimal/ico.ico similarity index 100% rename from src/tests/resources/minimal/ico.ico rename to src/lib/tests/resources/minimal/ico.ico diff --git a/src/tests/resources/minimal/jpg.jpg b/src/lib/tests/resources/minimal/jpg.jpg similarity index 100% rename from src/tests/resources/minimal/jpg.jpg rename to src/lib/tests/resources/minimal/jpg.jpg diff --git a/src/tests/resources/minimal/mp4.mp4 b/src/lib/tests/resources/minimal/mp4.mp4 similarity index 100% rename from src/tests/resources/minimal/mp4.mp4 rename to src/lib/tests/resources/minimal/mp4.mp4 diff --git a/src/tests/resources/minimal/png.png b/src/lib/tests/resources/minimal/png.png similarity index 100% rename from src/tests/resources/minimal/png.png rename to src/lib/tests/resources/minimal/png.png diff --git a/src/tests/resources/minimal/swf.swf b/src/lib/tests/resources/minimal/swf.swf similarity index 100% rename from src/tests/resources/minimal/swf.swf rename to src/lib/tests/resources/minimal/swf.swf diff --git a/src/tests/resources/minimal/txt.txt b/src/lib/tests/resources/minimal/txt.txt similarity index 100% rename from src/tests/resources/minimal/txt.txt rename to src/lib/tests/resources/minimal/txt.txt diff --git a/src/tests/resources/minimal/webm.webm b/src/lib/tests/resources/minimal/webm.webm similarity index 100% rename from src/tests/resources/minimal/webm.webm rename to src/lib/tests/resources/minimal/webm.webm diff --git a/src/tests/resources/oauth2/no_token_type.json b/src/lib/tests/resources/oauth2/no_token_type.json similarity index 100% rename from src/tests/resources/oauth2/no_token_type.json rename to src/lib/tests/resources/oauth2/no_token_type.json diff --git a/src/tests/resources/oauth2/ok.json b/src/lib/tests/resources/oauth2/ok.json similarity index 100% rename from src/tests/resources/oauth2/ok.json rename to src/lib/tests/resources/oauth2/ok.json diff --git a/src/tests/resources/oauth2/ok_in_response.json b/src/lib/tests/resources/oauth2/ok_in_response.json similarity index 100% rename from src/tests/resources/oauth2/ok_in_response.json rename to src/lib/tests/resources/oauth2/ok_in_response.json diff --git a/src/tests/resources/oauth2/wrong_token_type.json b/src/lib/tests/resources/oauth2/wrong_token_type.json similarity index 100% rename from src/tests/resources/oauth2/wrong_token_type.json rename to src/lib/tests/resources/oauth2/wrong_token_type.json diff --git a/src/tests/resources/pages/behoimi.org/homepage.html b/src/lib/tests/resources/pages/behoimi.org/homepage.html similarity index 100% rename from src/tests/resources/pages/behoimi.org/homepage.html rename to src/lib/tests/resources/pages/behoimi.org/homepage.html diff --git a/src/tests/resources/pages/behoimi.org/results.html b/src/lib/tests/resources/pages/behoimi.org/results.html similarity index 100% rename from src/tests/resources/pages/behoimi.org/results.html rename to src/lib/tests/resources/pages/behoimi.org/results.html diff --git a/src/tests/resources/pages/behoimi.org/results.json b/src/lib/tests/resources/pages/behoimi.org/results.json similarity index 100% rename from src/tests/resources/pages/behoimi.org/results.json rename to src/lib/tests/resources/pages/behoimi.org/results.json diff --git a/src/tests/resources/pages/behoimi.org/results.xml b/src/lib/tests/resources/pages/behoimi.org/results.xml similarity index 100% rename from src/tests/resources/pages/behoimi.org/results.xml rename to src/lib/tests/resources/pages/behoimi.org/results.xml diff --git a/src/tests/resources/pages/behoimi.org/tags.html b/src/lib/tests/resources/pages/behoimi.org/tags.html similarity index 100% rename from src/tests/resources/pages/behoimi.org/tags.html rename to src/lib/tests/resources/pages/behoimi.org/tags.html diff --git a/src/tests/resources/pages/behoimi.org/tags.json b/src/lib/tests/resources/pages/behoimi.org/tags.json similarity index 100% rename from src/tests/resources/pages/behoimi.org/tags.json rename to src/lib/tests/resources/pages/behoimi.org/tags.json diff --git a/src/tests/resources/pages/behoimi.org/tags.xml b/src/lib/tests/resources/pages/behoimi.org/tags.xml similarity index 100% rename from src/tests/resources/pages/behoimi.org/tags.xml rename to src/lib/tests/resources/pages/behoimi.org/tags.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/47a890d045ebe564e816a774814ae2f6.json b/src/lib/tests/resources/pages/danbooru.donmai.us/47a890d045ebe564e816a774814ae2f6.json similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/47a890d045ebe564e816a774814ae2f6.json rename to src/lib/tests/resources/pages/danbooru.donmai.us/47a890d045ebe564e816a774814ae2f6.json diff --git a/src/tests/resources/pages/danbooru.donmai.us/aeb54553c54f6d4b3ddaf297b7b01fd7.html b/src/lib/tests/resources/pages/danbooru.donmai.us/aeb54553c54f6d4b3ddaf297b7b01fd7.html similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/aeb54553c54f6d4b3ddaf297b7b01fd7.html rename to src/lib/tests/resources/pages/danbooru.donmai.us/aeb54553c54f6d4b3ddaf297b7b01fd7.html diff --git a/src/tests/resources/pages/danbooru.donmai.us/homepage.html b/src/lib/tests/resources/pages/danbooru.donmai.us/homepage.html similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/homepage.html rename to src/lib/tests/resources/pages/danbooru.donmai.us/homepage.html diff --git a/src/tests/resources/pages/danbooru.donmai.us/login.html b/src/lib/tests/resources/pages/danbooru.donmai.us/login.html similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/login.html rename to src/lib/tests/resources/pages/danbooru.donmai.us/login.html diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-1-1.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-1-1.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-1-1.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-1-1.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-1-2.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-1-2.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-1-2.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-1-2.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-1-3.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-1-3.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-1-3.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-1-3.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-1.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-1.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-1.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-1.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-2.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-2.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-2.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-2.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-3.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-3.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-3.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-3.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-4.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-4.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-4.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-4.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-5.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-5.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-5.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-5.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-6.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-6.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-6.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-6.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-7.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-7.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-7.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-7.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-8.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-8.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-2-8.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-2-8.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/pack-loader-20-1.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-20-1.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/pack-loader-20-1.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/pack-loader-20-1.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/results.html b/src/lib/tests/resources/pages/danbooru.donmai.us/results.html similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/results.html rename to src/lib/tests/resources/pages/danbooru.donmai.us/results.html diff --git a/src/tests/resources/pages/danbooru.donmai.us/results.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/results.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/results.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/results.xml diff --git a/src/tests/resources/pages/danbooru.donmai.us/tags.html b/src/lib/tests/resources/pages/danbooru.donmai.us/tags.html similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/tags.html rename to src/lib/tests/resources/pages/danbooru.donmai.us/tags.html diff --git a/src/tests/resources/pages/danbooru.donmai.us/tags.json b/src/lib/tests/resources/pages/danbooru.donmai.us/tags.json similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/tags.json rename to src/lib/tests/resources/pages/danbooru.donmai.us/tags.json diff --git a/src/tests/resources/pages/danbooru.donmai.us/tags.xml b/src/lib/tests/resources/pages/danbooru.donmai.us/tags.xml similarity index 100% rename from src/tests/resources/pages/danbooru.donmai.us/tags.xml rename to src/lib/tests/resources/pages/danbooru.donmai.us/tags.xml diff --git a/src/tests/resources/pages/derpibooru.org/results.html b/src/lib/tests/resources/pages/derpibooru.org/results.html similarity index 100% rename from src/tests/resources/pages/derpibooru.org/results.html rename to src/lib/tests/resources/pages/derpibooru.org/results.html diff --git a/src/tests/resources/pages/derpibooru.org/results.json b/src/lib/tests/resources/pages/derpibooru.org/results.json similarity index 100% rename from src/tests/resources/pages/derpibooru.org/results.json rename to src/lib/tests/resources/pages/derpibooru.org/results.json diff --git a/src/tests/resources/pages/derpibooru.org/tags.html b/src/lib/tests/resources/pages/derpibooru.org/tags.html similarity index 100% rename from src/tests/resources/pages/derpibooru.org/tags.html rename to src/lib/tests/resources/pages/derpibooru.org/tags.html diff --git a/src/tests/resources/pages/derpibooru.org/tags.json b/src/lib/tests/resources/pages/derpibooru.org/tags.json similarity index 100% rename from src/tests/resources/pages/derpibooru.org/tags.json rename to src/lib/tests/resources/pages/derpibooru.org/tags.json diff --git a/src/tests/resources/pages/e-hentai.org/pack-loader-gallery-1-1.html b/src/lib/tests/resources/pages/e-hentai.org/pack-loader-gallery-1-1.html similarity index 100% rename from src/tests/resources/pages/e-hentai.org/pack-loader-gallery-1-1.html rename to src/lib/tests/resources/pages/e-hentai.org/pack-loader-gallery-1-1.html diff --git a/src/tests/resources/pages/e-hentai.org/pack-loader-gallery-2-1.html b/src/lib/tests/resources/pages/e-hentai.org/pack-loader-gallery-2-1.html similarity index 100% rename from src/tests/resources/pages/e-hentai.org/pack-loader-gallery-2-1.html rename to src/lib/tests/resources/pages/e-hentai.org/pack-loader-gallery-2-1.html diff --git a/src/tests/resources/pages/e-hentai.org/pack-loader-gallery-3-1.html b/src/lib/tests/resources/pages/e-hentai.org/pack-loader-gallery-3-1.html similarity index 100% rename from src/tests/resources/pages/e-hentai.org/pack-loader-gallery-3-1.html rename to src/lib/tests/resources/pages/e-hentai.org/pack-loader-gallery-3-1.html diff --git a/src/tests/resources/pages/e-hentai.org/pack-loader-list.html b/src/lib/tests/resources/pages/e-hentai.org/pack-loader-list.html similarity index 100% rename from src/tests/resources/pages/e-hentai.org/pack-loader-list.html rename to src/lib/tests/resources/pages/e-hentai.org/pack-loader-list.html diff --git a/src/tests/resources/pages/e621.net/results.html b/src/lib/tests/resources/pages/e621.net/results.html similarity index 100% rename from src/tests/resources/pages/e621.net/results.html rename to src/lib/tests/resources/pages/e621.net/results.html diff --git a/src/tests/resources/pages/e621.net/results.json b/src/lib/tests/resources/pages/e621.net/results.json similarity index 100% rename from src/tests/resources/pages/e621.net/results.json rename to src/lib/tests/resources/pages/e621.net/results.json diff --git a/src/tests/resources/pages/e621.net/tags.html b/src/lib/tests/resources/pages/e621.net/tags.html similarity index 100% rename from src/tests/resources/pages/e621.net/tags.html rename to src/lib/tests/resources/pages/e621.net/tags.html diff --git a/src/tests/resources/pages/e621.net/tags.json b/src/lib/tests/resources/pages/e621.net/tags.json similarity index 100% rename from src/tests/resources/pages/e621.net/tags.json rename to src/lib/tests/resources/pages/e621.net/tags.json diff --git a/src/tests/resources/pages/gelbooru.com/pack-loader-1.html b/src/lib/tests/resources/pages/gelbooru.com/pack-loader-1.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/pack-loader-1.html rename to src/lib/tests/resources/pages/gelbooru.com/pack-loader-1.html diff --git a/src/tests/resources/pages/gelbooru.com/pack-loader-2.html b/src/lib/tests/resources/pages/gelbooru.com/pack-loader-2.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/pack-loader-2.html rename to src/lib/tests/resources/pages/gelbooru.com/pack-loader-2.html diff --git a/src/tests/resources/pages/gelbooru.com/pack-loader-3.html b/src/lib/tests/resources/pages/gelbooru.com/pack-loader-3.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/pack-loader-3.html rename to src/lib/tests/resources/pages/gelbooru.com/pack-loader-3.html diff --git a/src/tests/resources/pages/gelbooru.com/pack-loader-4.html b/src/lib/tests/resources/pages/gelbooru.com/pack-loader-4.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/pack-loader-4.html rename to src/lib/tests/resources/pages/gelbooru.com/pack-loader-4.html diff --git a/src/tests/resources/pages/gelbooru.com/pack-loader-5.html b/src/lib/tests/resources/pages/gelbooru.com/pack-loader-5.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/pack-loader-5.html rename to src/lib/tests/resources/pages/gelbooru.com/pack-loader-5.html diff --git a/src/tests/resources/pages/gelbooru.com/pack-loader-6.html b/src/lib/tests/resources/pages/gelbooru.com/pack-loader-6.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/pack-loader-6.html rename to src/lib/tests/resources/pages/gelbooru.com/pack-loader-6.html diff --git a/src/tests/resources/pages/gelbooru.com/pack-loader-7.html b/src/lib/tests/resources/pages/gelbooru.com/pack-loader-7.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/pack-loader-7.html rename to src/lib/tests/resources/pages/gelbooru.com/pack-loader-7.html diff --git a/src/tests/resources/pages/gelbooru.com/results.html b/src/lib/tests/resources/pages/gelbooru.com/results.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/results.html rename to src/lib/tests/resources/pages/gelbooru.com/results.html diff --git a/src/tests/resources/pages/gelbooru.com/results.xml b/src/lib/tests/resources/pages/gelbooru.com/results.xml similarity index 100% rename from src/tests/resources/pages/gelbooru.com/results.xml rename to src/lib/tests/resources/pages/gelbooru.com/results.xml diff --git a/src/tests/resources/pages/gelbooru.com/tags.html b/src/lib/tests/resources/pages/gelbooru.com/tags.html similarity index 100% rename from src/tests/resources/pages/gelbooru.com/tags.html rename to src/lib/tests/resources/pages/gelbooru.com/tags.html diff --git a/src/tests/resources/pages/idol.sankakucomplex.com/results-animated.html b/src/lib/tests/resources/pages/idol.sankakucomplex.com/results-animated.html similarity index 100% rename from src/tests/resources/pages/idol.sankakucomplex.com/results-animated.html rename to src/lib/tests/resources/pages/idol.sankakucomplex.com/results-animated.html diff --git a/src/tests/resources/pages/idol.sankakucomplex.com/results.html b/src/lib/tests/resources/pages/idol.sankakucomplex.com/results.html similarity index 100% rename from src/tests/resources/pages/idol.sankakucomplex.com/results.html rename to src/lib/tests/resources/pages/idol.sankakucomplex.com/results.html diff --git a/src/tests/resources/pages/idol.sankakucomplex.com/results.json b/src/lib/tests/resources/pages/idol.sankakucomplex.com/results.json similarity index 100% rename from src/tests/resources/pages/idol.sankakucomplex.com/results.json rename to src/lib/tests/resources/pages/idol.sankakucomplex.com/results.json diff --git a/src/tests/resources/pages/raw.githubusercontent.com/01724e365aa7000ecfa0fd8ae19cb9cf.xml b/src/lib/tests/resources/pages/raw.githubusercontent.com/01724e365aa7000ecfa0fd8ae19cb9cf.xml similarity index 100% rename from src/tests/resources/pages/raw.githubusercontent.com/01724e365aa7000ecfa0fd8ae19cb9cf.xml rename to src/lib/tests/resources/pages/raw.githubusercontent.com/01724e365aa7000ecfa0fd8ae19cb9cf.xml diff --git a/src/tests/resources/pages/raw.githubusercontent.com/68eca83cc435e3fa27a1324e60fb41b8.xml b/src/lib/tests/resources/pages/raw.githubusercontent.com/68eca83cc435e3fa27a1324e60fb41b8.xml similarity index 100% rename from src/tests/resources/pages/raw.githubusercontent.com/68eca83cc435e3fa27a1324e60fb41b8.xml rename to src/lib/tests/resources/pages/raw.githubusercontent.com/68eca83cc435e3fa27a1324e60fb41b8.xml diff --git a/src/tests/resources/pages/rm.booru.org/results.html b/src/lib/tests/resources/pages/rm.booru.org/results.html similarity index 100% rename from src/tests/resources/pages/rm.booru.org/results.html rename to src/lib/tests/resources/pages/rm.booru.org/results.html diff --git a/src/tests/resources/pages/www.zerochan.net/results.html b/src/lib/tests/resources/pages/www.zerochan.net/results.html similarity index 100% rename from src/tests/resources/pages/www.zerochan.net/results.html rename to src/lib/tests/resources/pages/www.zerochan.net/results.html diff --git a/src/tests/resources/pages/www.zerochan.net/results.rss b/src/lib/tests/resources/pages/www.zerochan.net/results.rss similarity index 100% rename from src/tests/resources/pages/www.zerochan.net/results.rss rename to src/lib/tests/resources/pages/www.zerochan.net/results.rss diff --git a/src/tests/resources/recurse/test.txt b/src/lib/tests/resources/recurse/test.txt similarity index 100% rename from src/tests/resources/recurse/test.txt rename to src/lib/tests/resources/recurse/test.txt diff --git a/src/tests/resources/recurse/test/test1.txt b/src/lib/tests/resources/recurse/test/test1.txt similarity index 100% rename from src/tests/resources/recurse/test/test1.txt rename to src/lib/tests/resources/recurse/test/test1.txt diff --git a/src/tests/resources/recurse/test/test2.txt b/src/lib/tests/resources/recurse/test/test2.txt similarity index 100% rename from src/tests/resources/recurse/test/test2.txt rename to src/lib/tests/resources/recurse/test/test2.txt diff --git a/src/tests/resources/sites/Danbooru (2.0)/danbooru.donmai.us/tag-types.txt b/src/lib/tests/resources/sites/Danbooru (2.0)/danbooru.donmai.us/tag-types.txt similarity index 100% rename from src/tests/resources/sites/Danbooru (2.0)/danbooru.donmai.us/tag-types.txt rename to src/lib/tests/resources/sites/Danbooru (2.0)/danbooru.donmai.us/tag-types.txt diff --git a/src/tests/resources/sites/Danbooru/behoimi.org/tag-types.txt b/src/lib/tests/resources/sites/Danbooru/behoimi.org/tag-types.txt similarity index 100% rename from src/tests/resources/sites/Danbooru/behoimi.org/tag-types.txt rename to src/lib/tests/resources/sites/Danbooru/behoimi.org/tag-types.txt diff --git a/src/tests/resources/sites/Danbooru/e621.net/tag-types.txt b/src/lib/tests/resources/sites/Danbooru/e621.net/tag-types.txt similarity index 100% rename from src/tests/resources/sites/Danbooru/e621.net/tag-types.txt rename to src/lib/tests/resources/sites/Danbooru/e621.net/tag-types.txt diff --git a/src/tests/resources/sites/Danbooru/sites.txt b/src/lib/tests/resources/sites/Danbooru/sites.txt similarity index 100% rename from src/tests/resources/sites/Danbooru/sites.txt rename to src/lib/tests/resources/sites/Danbooru/sites.txt diff --git a/src/tests/resources/tag-types.txt b/src/lib/tests/resources/tag-types.txt similarity index 100% rename from src/tests/resources/tag-types.txt rename to src/lib/tests/resources/tag-types.txt diff --git a/src/tests/resources/你好.txt b/src/lib/tests/resources/你好.txt similarity index 100% rename from src/tests/resources/你好.txt rename to src/lib/tests/resources/你好.txt diff --git a/src/tests/src/auth/auth-field-test.cpp b/src/lib/tests/src/auth/auth-field-test.cpp similarity index 100% rename from src/tests/src/auth/auth-field-test.cpp rename to src/lib/tests/src/auth/auth-field-test.cpp diff --git a/src/tests/src/auth/auth-test.cpp b/src/lib/tests/src/auth/auth-test.cpp similarity index 100% rename from src/tests/src/auth/auth-test.cpp rename to src/lib/tests/src/auth/auth-test.cpp diff --git a/src/tests/src/commands/sql-worker-test.cpp b/src/lib/tests/src/commands/sql-worker-test.cpp similarity index 100% rename from src/tests/src/commands/sql-worker-test.cpp rename to src/lib/tests/src/commands/sql-worker-test.cpp diff --git a/src/tests/src/concurrent-multi-queue-test.cpp b/src/lib/tests/src/concurrent-multi-queue-test.cpp similarity index 100% rename from src/tests/src/concurrent-multi-queue-test.cpp rename to src/lib/tests/src/concurrent-multi-queue-test.cpp diff --git a/src/tests/src/downloader/batch-downloader-test.cpp b/src/lib/tests/src/downloader/batch-downloader-test.cpp similarity index 100% rename from src/tests/src/downloader/batch-downloader-test.cpp rename to src/lib/tests/src/downloader/batch-downloader-test.cpp diff --git a/src/tests/src/downloader/download-query-group-test.cpp b/src/lib/tests/src/downloader/download-query-group-test.cpp similarity index 100% rename from src/tests/src/downloader/download-query-group-test.cpp rename to src/lib/tests/src/downloader/download-query-group-test.cpp diff --git a/src/tests/src/downloader/download-query-image-test.cpp b/src/lib/tests/src/downloader/download-query-image-test.cpp similarity index 100% rename from src/tests/src/downloader/download-query-image-test.cpp rename to src/lib/tests/src/downloader/download-query-image-test.cpp diff --git a/src/tests/src/downloader/extension-rotator-test.cpp b/src/lib/tests/src/downloader/extension-rotator-test.cpp similarity index 100% rename from src/tests/src/downloader/extension-rotator-test.cpp rename to src/lib/tests/src/downloader/extension-rotator-test.cpp diff --git a/src/tests/src/downloader/file-downloader-test.cpp b/src/lib/tests/src/downloader/file-downloader-test.cpp similarity index 97% rename from src/tests/src/downloader/file-downloader-test.cpp rename to src/lib/tests/src/downloader/file-downloader-test.cpp index 5dd72c21..b496f6a1 100644 --- a/src/tests/src/downloader/file-downloader-test.cpp +++ b/src/lib/tests/src/downloader/file-downloader-test.cpp @@ -29,7 +29,7 @@ TEST_CASE("FileDownloader") SECTION("Success") { - CustomNetworkAccessManager::NextFiles.enqueue("gui/resources/images/icon.png"); + CustomNetworkAccessManager::NextFiles.enqueue("../gui/resources/images/icon.png"); NetworkReply *reply = accessManager.get(QNetworkRequest(QUrl(successUrl))); QString dest = "single.png"; diff --git a/src/tests/src/downloader/image-downloader-test.cpp b/src/lib/tests/src/downloader/image-downloader-test.cpp similarity index 98% rename from src/tests/src/downloader/image-downloader-test.cpp rename to src/lib/tests/src/downloader/image-downloader-test.cpp index 087760b3..9a0de798 100644 --- a/src/tests/src/downloader/image-downloader-test.cpp +++ b/src/lib/tests/src/downloader/image-downloader-test.cpp @@ -261,7 +261,7 @@ TEST_CASE("ImageDownloader") settings->setValue("ImageSize/maxWidthEnabled", true); settings->setValue("ImageSize/maxWidth", 50); - CustomNetworkAccessManager::NextFiles.enqueue("gui/resources/images/colors/original.jpg"); // 256x256 + CustomNetworkAccessManager::NextFiles.enqueue("../gui/resources/images/colors/original.jpg"); // 256x256 QString path = QDir::toNativeSeparators("tests/resources/tmp/out.jpg"); auto img = createImage(profile, site); @@ -284,7 +284,7 @@ TEST_CASE("ImageDownloader") settings->setValue("ImageSize/maxWidthEnabled", true); settings->setValue("ImageSize/maxWidth", 500); - CustomNetworkAccessManager::NextFiles.enqueue("gui/resources/images/colors/original.jpg"); // 256x256 + CustomNetworkAccessManager::NextFiles.enqueue("../gui/resources/images/colors/original.jpg"); // 256x256 QString path = QDir::toNativeSeparators("tests/resources/tmp/out.jpg"); auto img = createImage(profile, site); diff --git a/src/tests/src/downloader/image-save-result-test.cpp b/src/lib/tests/src/downloader/image-save-result-test.cpp similarity index 100% rename from src/tests/src/downloader/image-save-result-test.cpp rename to src/lib/tests/src/downloader/image-save-result-test.cpp diff --git a/src/tests/src/exponential-moving-average-test.cpp b/src/lib/tests/src/exponential-moving-average-test.cpp similarity index 100% rename from src/tests/src/exponential-moving-average-test.cpp rename to src/lib/tests/src/exponential-moving-average-test.cpp diff --git a/src/tests/src/filename/conditional-filename-test.cpp b/src/lib/tests/src/filename/conditional-filename-test.cpp similarity index 100% rename from src/tests/src/filename/conditional-filename-test.cpp rename to src/lib/tests/src/filename/conditional-filename-test.cpp diff --git a/src/tests/src/filename/filename-condition-visitor-test.cpp b/src/lib/tests/src/filename/filename-condition-visitor-test.cpp similarity index 100% rename from src/tests/src/filename/filename-condition-visitor-test.cpp rename to src/lib/tests/src/filename/filename-condition-visitor-test.cpp diff --git a/src/tests/src/filename/filename-execution-visitor-test.cpp b/src/lib/tests/src/filename/filename-execution-visitor-test.cpp similarity index 100% rename from src/tests/src/filename/filename-execution-visitor-test.cpp rename to src/lib/tests/src/filename/filename-execution-visitor-test.cpp diff --git a/src/tests/src/filename/filename-parser-test.cpp b/src/lib/tests/src/filename/filename-parser-test.cpp similarity index 100% rename from src/tests/src/filename/filename-parser-test.cpp rename to src/lib/tests/src/filename/filename-parser-test.cpp diff --git a/src/tests/src/filename/filename-print-visitor-test.cpp b/src/lib/tests/src/filename/filename-print-visitor-test.cpp similarity index 100% rename from src/tests/src/filename/filename-print-visitor-test.cpp rename to src/lib/tests/src/filename/filename-print-visitor-test.cpp diff --git a/src/tests/src/filename/filename-resolution-visitor-test.cpp b/src/lib/tests/src/filename/filename-resolution-visitor-test.cpp similarity index 100% rename from src/tests/src/filename/filename-resolution-visitor-test.cpp rename to src/lib/tests/src/filename/filename-resolution-visitor-test.cpp diff --git a/src/tests/src/filename/filename-test.cpp b/src/lib/tests/src/filename/filename-test.cpp similarity index 100% rename from src/tests/src/filename/filename-test.cpp rename to src/lib/tests/src/filename/filename-test.cpp diff --git a/src/tests/src/functions-test.cpp b/src/lib/tests/src/functions-test.cpp similarity index 100% rename from src/tests/src/functions-test.cpp rename to src/lib/tests/src/functions-test.cpp diff --git a/src/tests/src/integration/behoimi-test.cpp b/src/lib/tests/src/integration/behoimi-test.cpp similarity index 100% rename from src/tests/src/integration/behoimi-test.cpp rename to src/lib/tests/src/integration/behoimi-test.cpp diff --git a/src/tests/src/integration/booru-org-test.cpp b/src/lib/tests/src/integration/booru-org-test.cpp similarity index 100% rename from src/tests/src/integration/booru-org-test.cpp rename to src/lib/tests/src/integration/booru-org-test.cpp diff --git a/src/tests/src/integration/danbooru-test.cpp b/src/lib/tests/src/integration/danbooru-test.cpp similarity index 100% rename from src/tests/src/integration/danbooru-test.cpp rename to src/lib/tests/src/integration/danbooru-test.cpp diff --git a/src/tests/src/integration/derpibooru-test.cpp b/src/lib/tests/src/integration/derpibooru-test.cpp similarity index 100% rename from src/tests/src/integration/derpibooru-test.cpp rename to src/lib/tests/src/integration/derpibooru-test.cpp diff --git a/src/tests/src/integration/e621-test.cpp b/src/lib/tests/src/integration/e621-test.cpp similarity index 100% rename from src/tests/src/integration/e621-test.cpp rename to src/lib/tests/src/integration/e621-test.cpp diff --git a/src/tests/src/integration/gelbooru-test.cpp b/src/lib/tests/src/integration/gelbooru-test.cpp similarity index 100% rename from src/tests/src/integration/gelbooru-test.cpp rename to src/lib/tests/src/integration/gelbooru-test.cpp diff --git a/src/tests/src/integration/integration-helpers.cpp b/src/lib/tests/src/integration/integration-helpers.cpp similarity index 100% rename from src/tests/src/integration/integration-helpers.cpp rename to src/lib/tests/src/integration/integration-helpers.cpp diff --git a/src/tests/src/integration/integration-helpers.h b/src/lib/tests/src/integration/integration-helpers.h similarity index 100% rename from src/tests/src/integration/integration-helpers.h rename to src/lib/tests/src/integration/integration-helpers.h diff --git a/src/tests/src/integration/sankaku-test.cpp b/src/lib/tests/src/integration/sankaku-test.cpp similarity index 100% rename from src/tests/src/integration/sankaku-test.cpp rename to src/lib/tests/src/integration/sankaku-test.cpp diff --git a/src/tests/src/integration/zerochan-test.cpp b/src/lib/tests/src/integration/zerochan-test.cpp similarity index 100% rename from src/tests/src/integration/zerochan-test.cpp rename to src/lib/tests/src/integration/zerochan-test.cpp diff --git a/src/tests/src/language-loader-test.cpp b/src/lib/tests/src/language-loader-test.cpp similarity index 100% rename from src/tests/src/language-loader-test.cpp rename to src/lib/tests/src/language-loader-test.cpp diff --git a/src/tests/src/loader/pack-loader-test.cpp b/src/lib/tests/src/loader/pack-loader-test.cpp similarity index 100% rename from src/tests/src/loader/pack-loader-test.cpp rename to src/lib/tests/src/loader/pack-loader-test.cpp diff --git a/src/tests/src/loader/token-test.cpp b/src/lib/tests/src/loader/token-test.cpp similarity index 100% rename from src/tests/src/loader/token-test.cpp rename to src/lib/tests/src/loader/token-test.cpp diff --git a/src/tests/src/login/http-login-test.cpp b/src/lib/tests/src/login/http-login-test.cpp similarity index 100% rename from src/tests/src/login/http-login-test.cpp rename to src/lib/tests/src/login/http-login-test.cpp diff --git a/src/tests/src/login/oauth2-login-test.cpp b/src/lib/tests/src/login/oauth2-login-test.cpp similarity index 100% rename from src/tests/src/login/oauth2-login-test.cpp rename to src/lib/tests/src/login/oauth2-login-test.cpp diff --git a/src/tests/src/login/url-login-test.cpp b/src/lib/tests/src/login/url-login-test.cpp similarity index 100% rename from src/tests/src/login/url-login-test.cpp rename to src/lib/tests/src/login/url-login-test.cpp diff --git a/src/tests/src/mixed-settings-test.cpp b/src/lib/tests/src/mixed-settings-test.cpp similarity index 100% rename from src/tests/src/mixed-settings-test.cpp rename to src/lib/tests/src/mixed-settings-test.cpp diff --git a/src/tests/src/models/favorite-test.cpp b/src/lib/tests/src/models/favorite-test.cpp similarity index 100% rename from src/tests/src/models/favorite-test.cpp rename to src/lib/tests/src/models/favorite-test.cpp diff --git a/src/tests/src/models/filtering/blacklist-test.cpp b/src/lib/tests/src/models/filtering/blacklist-test.cpp similarity index 100% rename from src/tests/src/models/filtering/blacklist-test.cpp rename to src/lib/tests/src/models/filtering/blacklist-test.cpp diff --git a/src/tests/src/models/filtering/meta-filter-test.cpp b/src/lib/tests/src/models/filtering/meta-filter-test.cpp similarity index 100% rename from src/tests/src/models/filtering/meta-filter-test.cpp rename to src/lib/tests/src/models/filtering/meta-filter-test.cpp diff --git a/src/tests/src/models/filtering/post-filter-test.cpp b/src/lib/tests/src/models/filtering/post-filter-test.cpp similarity index 100% rename from src/tests/src/models/filtering/post-filter-test.cpp rename to src/lib/tests/src/models/filtering/post-filter-test.cpp diff --git a/src/tests/src/models/filtering/tag-filter-test.cpp b/src/lib/tests/src/models/filtering/tag-filter-test.cpp similarity index 100% rename from src/tests/src/models/filtering/tag-filter-test.cpp rename to src/lib/tests/src/models/filtering/tag-filter-test.cpp diff --git a/src/tests/src/models/filtering/token-filter-test.cpp b/src/lib/tests/src/models/filtering/token-filter-test.cpp similarity index 100% rename from src/tests/src/models/filtering/token-filter-test.cpp rename to src/lib/tests/src/models/filtering/token-filter-test.cpp diff --git a/src/tests/src/models/image-size-test.cpp b/src/lib/tests/src/models/image-size-test.cpp similarity index 100% rename from src/tests/src/models/image-size-test.cpp rename to src/lib/tests/src/models/image-size-test.cpp diff --git a/src/tests/src/models/image-test.cpp b/src/lib/tests/src/models/image-test.cpp similarity index 100% rename from src/tests/src/models/image-test.cpp rename to src/lib/tests/src/models/image-test.cpp diff --git a/src/tests/src/models/md5-database/md5-database-sqlite-test.cpp b/src/lib/tests/src/models/md5-database/md5-database-sqlite-test.cpp similarity index 100% rename from src/tests/src/models/md5-database/md5-database-sqlite-test.cpp rename to src/lib/tests/src/models/md5-database/md5-database-sqlite-test.cpp diff --git a/src/tests/src/models/md5-database/md5-database-text-test.cpp b/src/lib/tests/src/models/md5-database/md5-database-text-test.cpp similarity index 100% rename from src/tests/src/models/md5-database/md5-database-text-test.cpp rename to src/lib/tests/src/models/md5-database/md5-database-text-test.cpp diff --git a/src/tests/src/models/page-api-test.cpp b/src/lib/tests/src/models/page-api-test.cpp similarity index 100% rename from src/tests/src/models/page-api-test.cpp rename to src/lib/tests/src/models/page-api-test.cpp diff --git a/src/tests/src/models/page-test.cpp b/src/lib/tests/src/models/page-test.cpp similarity index 100% rename from src/tests/src/models/page-test.cpp rename to src/lib/tests/src/models/page-test.cpp diff --git a/src/tests/src/models/pool-test.cpp b/src/lib/tests/src/models/pool-test.cpp similarity index 100% rename from src/tests/src/models/pool-test.cpp rename to src/lib/tests/src/models/pool-test.cpp diff --git a/src/tests/src/models/profile-test.cpp b/src/lib/tests/src/models/profile-test.cpp similarity index 100% rename from src/tests/src/models/profile-test.cpp rename to src/lib/tests/src/models/profile-test.cpp diff --git a/src/tests/src/models/site-test.cpp b/src/lib/tests/src/models/site-test.cpp similarity index 100% rename from src/tests/src/models/site-test.cpp rename to src/lib/tests/src/models/site-test.cpp diff --git a/src/tests/src/models/source-guesser-test.cpp b/src/lib/tests/src/models/source-guesser-test.cpp similarity index 100% rename from src/tests/src/models/source-guesser-test.cpp rename to src/lib/tests/src/models/source-guesser-test.cpp diff --git a/src/tests/src/models/source-test.cpp b/src/lib/tests/src/models/source-test.cpp similarity index 100% rename from src/tests/src/models/source-test.cpp rename to src/lib/tests/src/models/source-test.cpp diff --git a/src/tests/src/monitoring/monitor-test.cpp b/src/lib/tests/src/monitoring/monitor-test.cpp similarity index 100% rename from src/tests/src/monitoring/monitor-test.cpp rename to src/lib/tests/src/monitoring/monitor-test.cpp diff --git a/src/tests/src/network-manager-test.cpp b/src/lib/tests/src/network-manager-test.cpp similarity index 100% rename from src/tests/src/network-manager-test.cpp rename to src/lib/tests/src/network-manager-test.cpp diff --git a/src/tests/src/search/search-format-visitor-test.cpp b/src/lib/tests/src/search/search-format-visitor-test.cpp similarity index 100% rename from src/tests/src/search/search-format-visitor-test.cpp rename to src/lib/tests/src/search/search-format-visitor-test.cpp diff --git a/src/tests/src/tags/tag-api-test.cpp b/src/lib/tests/src/tags/tag-api-test.cpp similarity index 100% rename from src/tests/src/tags/tag-api-test.cpp rename to src/lib/tests/src/tags/tag-api-test.cpp diff --git a/src/tests/src/tags/tag-database-in-memory-test.cpp b/src/lib/tests/src/tags/tag-database-in-memory-test.cpp similarity index 100% rename from src/tests/src/tags/tag-database-in-memory-test.cpp rename to src/lib/tests/src/tags/tag-database-in-memory-test.cpp diff --git a/src/tests/src/tags/tag-database-sqlite-test.cpp b/src/lib/tests/src/tags/tag-database-sqlite-test.cpp similarity index 100% rename from src/tests/src/tags/tag-database-sqlite-test.cpp rename to src/lib/tests/src/tags/tag-database-sqlite-test.cpp diff --git a/src/tests/src/tags/tag-name-format-test.cpp b/src/lib/tests/src/tags/tag-name-format-test.cpp similarity index 100% rename from src/tests/src/tags/tag-name-format-test.cpp rename to src/lib/tests/src/tags/tag-name-format-test.cpp diff --git a/src/tests/src/tags/tag-name-test.cpp b/src/lib/tests/src/tags/tag-name-test.cpp similarity index 100% rename from src/tests/src/tags/tag-name-test.cpp rename to src/lib/tests/src/tags/tag-name-test.cpp diff --git a/src/tests/src/tags/tag-stylist-test.cpp b/src/lib/tests/src/tags/tag-stylist-test.cpp similarity index 100% rename from src/tests/src/tags/tag-stylist-test.cpp rename to src/lib/tests/src/tags/tag-stylist-test.cpp diff --git a/src/tests/src/tags/tag-test.cpp b/src/lib/tests/src/tags/tag-test.cpp similarity index 100% rename from src/tests/src/tags/tag-test.cpp rename to src/lib/tests/src/tags/tag-test.cpp diff --git a/src/tests/src/tags/tag-type-api-test.cpp b/src/lib/tests/src/tags/tag-type-api-test.cpp similarity index 100% rename from src/tests/src/tags/tag-type-api-test.cpp rename to src/lib/tests/src/tags/tag-type-api-test.cpp diff --git a/src/tests/src/tags/tag-type-database-test.cpp b/src/lib/tests/src/tags/tag-type-database-test.cpp similarity index 100% rename from src/tests/src/tags/tag-type-database-test.cpp rename to src/lib/tests/src/tags/tag-type-database-test.cpp diff --git a/src/tests/src/updater/source-updater-test.cpp b/src/lib/tests/src/updater/source-updater-test.cpp similarity index 100% rename from src/tests/src/updater/source-updater-test.cpp rename to src/lib/tests/src/updater/source-updater-test.cpp diff --git a/src/tests/src/updater/updater-test.cpp b/src/lib/tests/src/updater/updater-test.cpp similarity index 100% rename from src/tests/src/updater/updater-test.cpp rename to src/lib/tests/src/updater/updater-test.cpp diff --git a/src/tests/src/utils/file-utils-test.cpp b/src/lib/tests/src/utils/file-utils-test.cpp similarity index 100% rename from src/tests/src/utils/file-utils-test.cpp rename to src/lib/tests/src/utils/file-utils-test.cpp diff --git a/src/tests/src/utils/html-node-test.cpp b/src/lib/tests/src/utils/html-node-test.cpp similarity index 100% rename from src/tests/src/utils/html-node-test.cpp rename to src/lib/tests/src/utils/html-node-test.cpp diff --git a/src/tests/src/utils/logging.cpp b/src/lib/tests/src/utils/logging.cpp similarity index 100% rename from src/tests/src/utils/logging.cpp rename to src/lib/tests/src/utils/logging.cpp diff --git a/src/tests/src/utils/zip-test.cpp b/src/lib/tests/src/utils/zip-test.cpp similarity index 100% rename from src/tests/src/utils/zip-test.cpp rename to src/lib/tests/src/utils/zip-test.cpp diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 3961e774..782fa150 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,25 +1,3 @@ project(tests) -enable_testing() -add_definitions(-DTEST=1) -if(DEFINED HEADLESS) - add_definitions(-DHEADLESS=1) -endif() - -find_package(Qt5 COMPONENTS Gui Test Widgets REQUIRED) -set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Test Qt5::Widgets) - -file(GLOB_RECURSE SOURCES "src/*.cpp") -include_directories("src/" "src/common/" "." "../lib/src/" "../lib/vendor/lexbor/source/") - -add_executable(${PROJECT_NAME} ${SOURCES}) -add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) -target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} lib Catch2::Catch2) - -add_subdirectory(languages) add_subdirectory(vendor/catch) - -# Pre-compiled header -if(USE_PCH) - cotire(${PROJECT_NAME}) -endif() diff --git a/src/tests/src/common/catch.h b/src/tests/src/catch.h similarity index 100% rename from src/tests/src/common/catch.h rename to src/tests/src/catch.h diff --git a/src/tests/src/common/main.cpp b/src/tests/src/main.cpp similarity index 100% rename from src/tests/src/common/main.cpp rename to src/tests/src/main.cpp diff --git a/src/tests/src/common/raii-helpers.h b/src/tests/src/raii-helpers.h similarity index 100% rename from src/tests/src/common/raii-helpers.h rename to src/tests/src/raii-helpers.h diff --git a/src/tests/src/common/source-helpers.cpp b/src/tests/src/source-helpers.cpp similarity index 61% rename from src/tests/src/common/source-helpers.cpp rename to src/tests/src/source-helpers.cpp index 4d8f212a..548fb6bd 100644 --- a/src/tests/src/common/source-helpers.cpp +++ b/src/tests/src/source-helpers.cpp @@ -21,7 +21,7 @@ void setupSource(const QString &source, QString dir) dir = "tests/resources/sites/"; QFile::remove(dir + "helper.js"); - QFile("sites/helper.js").copy(dir + "helper.js"); + QFile("../sites/helper.js").copy(dir + "helper.js"); dir += source; } @@ -29,8 +29,8 @@ void setupSource(const QString &source, QString dir) QDir().mkpath(dir); QFile::remove(dir + "/model.js"); QFile::remove(dir + "/sites.txt"); - QFile("sites/" + source + "/model.js").copy(dir + "/model.js"); - QFile("sites/" + source + "/sites.txt").copy(dir + "/sites.txt"); + QFile("../sites/" + source + "/model.js").copy(dir + "/model.js"); + QFile("../sites/" + source + "/sites.txt").copy(dir + "/sites.txt"); } void setupSite(const QString &source, const QString &site, QString dir) @@ -43,10 +43,10 @@ void setupSite(const QString &source, const QString &site, QString dir) QFile::remove(dir + "/defaults.ini"); QFile::remove(dir + "/settings.ini"); QFile::remove(dir + "/tag-types.txt"); - if (QFile::exists("sites/" + source + "/" + site + "/defaults.ini")) { - QFile("sites/" + source + "/" + site + "/defaults.ini").copy(dir + "/defaults.ini"); + if (QFile::exists("../sites/" + source + "/" + site + "/defaults.ini")) { + QFile("../sites/" + source + "/" + site + "/defaults.ini").copy(dir + "/defaults.ini"); } - if (QFile::exists("sites/" + source + "/" + site + "/tag-types.txt")) { - QFile("sites/" + source + "/" + site + "/tag-types.txt").copy(dir + "/tag-types.txt"); + if (QFile::exists("../sites/" + source + "/" + site + "/tag-types.txt")) { + QFile("../sites/" + source + "/" + site + "/tag-types.txt").copy(dir + "/tag-types.txt"); } } diff --git a/src/tests/src/common/source-helpers.h b/src/tests/src/source-helpers.h similarity index 100% rename from src/tests/src/common/source-helpers.h rename to src/tests/src/source-helpers.h