mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Refactor LootSettings and LootState into GUI folder
And their tests into a new gui_tests executable.
This commit is contained in:
@@ -71,6 +71,7 @@ script:
|
||||
- make all
|
||||
- ./tests
|
||||
- ./api-tests
|
||||
- ./gui_tests
|
||||
|
||||
after_success:
|
||||
- cd $TRAVIS_BUILD_DIR
|
||||
|
||||
+21
-10
@@ -163,8 +163,6 @@ set(CEF_PRECOMPILED_BINARIES_DIR "${SOURCE_DIR}/Release")
|
||||
##############################
|
||||
|
||||
set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_settings.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_state.cpp"
|
||||
"${CMAKE_BINARY_DIR}/generated/loot_version.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/error_categories.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_evaluator.cpp"
|
||||
@@ -191,8 +189,6 @@ set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/helpers/version.cpp")
|
||||
|
||||
set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_settings.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_state.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_evaluator.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.h"
|
||||
@@ -236,6 +232,8 @@ set (LOOT_GUI_SRC "${CMAKE_SOURCE_DIR}/src/gui/main.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/loot_app.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/loot_scheme_handler_factory.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query_handler.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_settings.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_state.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/resource.rc")
|
||||
|
||||
set (LOOT_GUI_HEADERS "${CMAKE_SOURCE_DIR}/src/gui/editor_message.h"
|
||||
@@ -274,6 +272,8 @@ set (LOOT_GUI_HEADERS "${CMAKE_SOURCE_DIR}/src/gui/editor_message.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/sort_plugins_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query/update_masterlist_query.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/query_handler.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_settings.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_state.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/resource.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/yaml_simple_message_helpers.h")
|
||||
|
||||
@@ -302,12 +302,7 @@ set (LOOT_API_HEADERS "${CMAKE_SOURCE_DIR}/include/loot/api.h"
|
||||
|
||||
set (LOOT_TESTS_SRC "${CMAKE_SOURCE_DIR}/src/tests/backend/main.cpp")
|
||||
|
||||
set (LOOT_TESTS_HEADERS # Testing this here rather than as part of the API tests
|
||||
# because it tests internal code and requires internal
|
||||
# linking.
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/app/loot_paths_test.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/app/loot_settings_test.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/app/loot_state_test.h"
|
||||
set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/backend/app/loot_paths_test.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/game/game_test.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/game/game_cache_test.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/backend/game/game_settings_test.h"
|
||||
@@ -342,17 +337,28 @@ set(LOOT_API_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/api/api_game_operatio
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/api/is_compatible_test.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/common_game_test_fixture.h")
|
||||
|
||||
set(LOOT_GUI_TESTS_SRC "${CMAKE_SOURCE_DIR}/src/gui/state/loot_settings.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_state.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/gui/main.cpp")
|
||||
|
||||
set (LOOT_GUI_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/gui/state/loot_settings.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/state/loot_state.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/gui/state/loot_settings_test.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/tests/gui/state/loot_state_test.h")
|
||||
|
||||
source_group("Header Files\\backend" FILES ${LOOT_HEADERS})
|
||||
source_group("Header Files\\gui" FILES ${LOOT_GUI_HEADERS})
|
||||
source_group("Header Files\\api" FILES ${LOOT_API_HEADERS})
|
||||
source_group("Header Files\\tests" FILES ${LOOT_TESTS_HEADERS})
|
||||
source_group("Header Files\\tests" FILES ${LOOT_API_TESTS_HEADERS})
|
||||
source_group("Header Files\\tests" FILES ${LOOT_GUI_TESTS_HEADERS})
|
||||
|
||||
source_group("Source Files\\backend" FILES ${LOOT_SRC})
|
||||
source_group("Source Files\\gui" FILES ${LOOT_GUI_SRC})
|
||||
source_group("Source Files\\api" FILES ${LOOT_API_SRC})
|
||||
source_group("Source Files\\tests" FILES ${LOOT_TESTS_SRC})
|
||||
source_group("Source Files\\tests" FILES ${LOOT_API_TESTS_SRC})
|
||||
source_group("Header Files\\tests" FILES ${LOOT_GUI_TESTS_SRC})
|
||||
|
||||
# Include source and library directories.
|
||||
include_directories ("${CMAKE_SOURCE_DIR}/src"
|
||||
@@ -446,6 +452,10 @@ add_executable (LOOT ${LOOT_GUI_SRC} ${LOOT_GUI_HEADERS})
|
||||
add_dependencies (LOOT cef loot_common)
|
||||
target_link_libraries(LOOT ${CEF_LIBRARIES} loot_common ${LOOT_GUI_LIBS})
|
||||
|
||||
# Build application tests.
|
||||
add_executable (gui_tests ${LOOT_GUI_TESTS_SRC} ${LOOT_GUI_TESTS_HEADERS})
|
||||
add_dependencies (gui_tests loot_common GTest testing-metadata testing-plugins)
|
||||
target_link_libraries(gui_tests loot_common ${GTEST_LIBRARIES})
|
||||
|
||||
##############################
|
||||
# Set Target-Specific Flags
|
||||
@@ -465,6 +475,7 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set_target_properties (loot_common PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
|
||||
set_target_properties (tests PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
|
||||
set_target_properties (LOOT PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
|
||||
set_target_properties (gui_tests PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
set_target_properties (loot_api PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_EXPORT")
|
||||
ELSE ()
|
||||
|
||||
@@ -66,6 +66,10 @@ test_script:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%
|
||||
- tests.exe --gtest_output=xml:tests.xml
|
||||
- api-tests.exe --gtest_output=xml:api-tests.xml
|
||||
- ps: |
|
||||
if ($env:PLATFORM -eq 'Win32') {
|
||||
./gui_tests.exe --gtest_output=xml:gui_tests.xml
|
||||
}
|
||||
|
||||
after_test:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
@@ -162,3 +166,7 @@ on_success:
|
||||
on_finish:
|
||||
- ps: (New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "$($env:APPVEYOR_BUILD_FOLDER)\build\$($env:CONFIGURATION)\tests.xml")
|
||||
- ps: (New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "$($env:APPVEYOR_BUILD_FOLDER)\build\$($env:CONFIGURATION)\api-tests.xml")
|
||||
- ps: |
|
||||
if ($env:PLATFORM -eq 'Win32') {
|
||||
(New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "$($env:APPVEYOR_BUILD_FOLDER)\build\$($env:CONFIGURATION)\gui_tests.xml")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# commit if more than one line in it has changed, otherwise discard any changes
|
||||
# to it.
|
||||
|
||||
xgettext --keyword="translate:1,1t" --keyword="translate:1,2,3t" --keyword="translateFormatted:1" --add-location=full --from-code=utf-8 --package-name=LOOT --package-version=0.10.3 --copyright-holder="WrinklyNinja" --msgid-bugs-address="https://github.com/loot/loot/issues" -o resources/l10n/template.pot src/gui/html/js/*.* src/gui/*.cpp src/gui/query/*.h src/backend/*/*.* src/backend/*.*
|
||||
xgettext --keyword="translate:1,1t" --keyword="translate:1,2,3t" --keyword="translateFormatted:1" --add-location=full --from-code=utf-8 --package-name=LOOT --package-version=0.10.3 --copyright-holder="WrinklyNinja" --msgid-bugs-address="https://github.com/loot/loot/issues" -o resources/l10n/template.pot src/gui/html/js/*.* src/gui/*.cpp src/gui/query/*.h src/gui/*/*.cpp src/backend/*/*.* src/backend/*.*
|
||||
|
||||
sed -i 's|charset=CHARSET|charset=UTF-8|' resources/l10n/template.pot
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
#include <include/base/cef_lock.h>
|
||||
#include <include/wrapper/cef_message_router.h>
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
|
||||
namespace loot {
|
||||
class LootApp : public CefApp,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <include/cef_client.h>
|
||||
#include <include/wrapper/cef_message_router.h>
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
|
||||
namespace loot {
|
||||
class LootHandler : public CefClient,
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_CANCEL_SORT_QUERY
|
||||
#define LOOT_GUI_QUERY_CANCEL_SORT_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/json.h"
|
||||
#include "gui/query/metadata_query.h"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_CLOSE_SETTINGS_QUERY
|
||||
#define LOOT_GUI_QUERY_CLOSE_SETTINGS_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/get_installed_games_query.h"
|
||||
|
||||
namespace loot {
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_DISCARD_UNAPPLIED_CHANGES_QUERY
|
||||
#define LOOT_GUI_QUERY_DISCARD_UNAPPLIED_CHANGES_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/query.h"
|
||||
|
||||
namespace loot {
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_EDITOR_CLOSED_QUERY
|
||||
#define LOOT_GUI_QUERY_EDITOR_CLOSED_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/metadata_query.h"
|
||||
|
||||
namespace loot {
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_EDITOR_OPENED_QUERY
|
||||
#define LOOT_GUI_QUERY_EDITOR_OPENED_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/query.h"
|
||||
|
||||
namespace loot {
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_GET_INIT_ERRORS_QUERY
|
||||
#define LOOT_GUI_QUERY_GET_INIT_ERRORS_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/json.h"
|
||||
#include "gui/query/query.h"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_GET_INSTALLED_GAMES_QUERY
|
||||
#define LOOT_GUI_QUERY_GET_INSTALLED_GAMES_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/json.h"
|
||||
#include "gui/query/query.h"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_GET_SETTINGS_QUERY
|
||||
#define LOOT_GUI_QUERY_GET_SETTINGS_QUERY
|
||||
|
||||
#include "backend/app/loot_settings.h"
|
||||
#include "gui/state/loot_settings.h"
|
||||
#include "gui/query/json.h"
|
||||
#include "gui/query/query.h"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ along with LOOT. If not, see
|
||||
#ifndef LOOT_GUI_QUERY_REDATE_PLUGINS_QUERY
|
||||
#define LOOT_GUI_QUERY_REDATE_PLUGINS_QUERY
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/query.h"
|
||||
|
||||
namespace loot {
|
||||
|
||||
@@ -27,7 +27,7 @@ along with LOOT. If not, see
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/query.h"
|
||||
|
||||
namespace loot {
|
||||
|
||||
@@ -27,7 +27,7 @@ along with LOOT. If not, see
|
||||
|
||||
#include <boost/locale.hpp>
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "gui/query/json.h"
|
||||
#include "backend/plugin/plugin_sorter.h"
|
||||
#include "loot/exception/cyclic_interaction_error.h"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <include/wrapper/cef_message_router.h>
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include "backend/app/loot_state.h"
|
||||
#include "gui/state/loot_state.h"
|
||||
#include "backend/plugin/plugin.h"
|
||||
#include "backend/metadata/plugin_metadata.h"
|
||||
#include "gui/editor_message.h"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "backend/app/loot_settings.h"
|
||||
#include "gui/state/loot_settings.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user