chore: move lib tests to src/lib/tests
6
.github/workflows/build.yml
vendored
@ -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
@ -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/
|
||||
|
@ -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})
|
||||
|
@ -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})
|
||||
|
@ -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})
|
||||
|
@ -33,3 +33,6 @@ target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${LIBS})
|
||||
if(USE_PCH)
|
||||
cotire(${PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
# Tests
|
||||
add_subdirectory(tests)
|
||||
|
27
src/lib/tests/CMakeLists.txt
Normal 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()
|
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 58 B After Width: | Height: | Size: 58 B |
Before Width: | Height: | Size: 799 B After Width: | Height: | Size: 799 B |
Before Width: | Height: | Size: 70 B After Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 803 B After Width: | Height: | Size: 803 B |
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |