chore: move lib tests to src/lib/tests

This commit is contained in:
Bionus 2023-01-11 01:53:41 +01:00
parent c89e468143
commit e123ea4a82
No known key found for this signature in database
GPG Key ID: 54B0B2DE713AE915
175 changed files with 59 additions and 51 deletions

View File

@ -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

20
.gitignore vendored
View File

@ -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/

View File

@ -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})

View File

@ -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})

View File

@ -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})

View File

@ -33,3 +33,6 @@ target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${LIBS})
if(USE_PCH)
cotire(${PROJECT_NAME})
endif()
# Tests
add_subdirectory(tests)

View File

@ -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()

View File

Before

Width:  |  Height:  |  Size: 156 B

After

Width:  |  Height:  |  Size: 156 B

View File

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 643 B

View File

Before

Width:  |  Height:  |  Size: 58 B

After

Width:  |  Height:  |  Size: 58 B

View File

Before

Width:  |  Height:  |  Size: 799 B

After

Width:  |  Height:  |  Size: 799 B

View File

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

View File

Before

Width:  |  Height:  |  Size: 803 B

After

Width:  |  Height:  |  Size: 803 B

View File

Before

Width:  |  Height:  |  Size: 156 B

After

Width:  |  Height:  |  Size: 156 B

Some files were not shown because too many files have changed in this diff Show More