1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-14 22:42:34 +02:00

Fix tst_ScreenPlay

This commit is contained in:
Elias Steurer 2022-04-23 18:00:12 +02:00
parent bb700780ef
commit 50f198050d
41 changed files with 106 additions and 102 deletions

View File

@ -5,7 +5,7 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
set(SOURCES
app.cpp
src/app.cpp
src/create.cpp
src/createimportvideo.cpp
src/globalvariables.cpp
@ -23,24 +23,24 @@ set(SOURCES
src/wizards.cpp)
set(HEADER
app.h
src/create.h
src/createimportstates.h
src/createimportvideo.h
src/globalvariables.h
src/installedlistfilter.h
src/installedlistmodel.h
src/monitorlistmodel.h
src/profile.h
src/profilelistmodel.h
src/projectsettingslistmodel.h
src/screenplaymanager.h
src/screenplaywallpaper.h
src/screenplaywidget.h
src/sdkconnection.h
src/settings.h
src/util.h
src/wizards.h)
inc/public/ScreenPlay/app.h
inc/public/ScreenPlay/create.h
inc/public/ScreenPlay/createimportstates.h
inc/public/ScreenPlay/createimportvideo.h
inc/public/ScreenPlay/globalvariables.h
inc/public/ScreenPlay/installedlistfilter.h
inc/public/ScreenPlay/installedlistmodel.h
inc/public/ScreenPlay/monitorlistmodel.h
inc/public/ScreenPlay/profile.h
inc/public/ScreenPlay/profilelistmodel.h
inc/public/ScreenPlay/projectsettingslistmodel.h
inc/public/ScreenPlay/screenplaymanager.h
inc/public/ScreenPlay/screenplaywallpaper.h
inc/public/ScreenPlay/screenplaywidget.h
inc/public/ScreenPlay/sdkconnection.h
inc/public/ScreenPlay/settings.h
inc/public/ScreenPlay/util.h
inc/public/ScreenPlay/wizards.h)
set(QML
main.qml
@ -141,6 +141,11 @@ add_library(
${RESOURCES}
${FONTS})
target_include_directories(
ScreenPlayLib
PUBLIC inc/public/
PRIVATE src/)
target_link_libraries(
ScreenPlayLib
PUBLIC ScreenPlaySDK
@ -158,10 +163,17 @@ target_link_libraries(
ScreenPlayWorkshopplugin
ScreenPlayWorkshop
SteamSDKQtEnums)
target_include_directories(ScreenPlayLib PUBLIC )
qt_add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE ScreenPlayLib)
if(${SCREENPLAY_TESTS})
add_executable(tst_ScreenPlay tests/tst_main.cpp)
target_link_libraries(tst_ScreenPlay PRIVATE ScreenPlayLib Qt6::Test)
endif()
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/translations")
# qt_add_lupdate does not work for some reason. Lets do it manually:
@ -188,11 +200,6 @@ qt_add_qml_module(
QML_FILES
${QML})
#if(${SCREENPLAY_TESTS})
# add_executable(tst_ScreenPlay tests/tst_main.cpp)
# target_link_libraries(tst_ScreenPlay PRIVATE ScreenPlayLib Qt6::Test)
#endif()
if(WIN32)
# Icon
target_sources(${PROJECT_NAME} PRIVATE ScreenPlay.rc)

View File

@ -49,16 +49,16 @@
#include <QtQml>
#include <QtSvg>
#include "src/create.h"
#include "src/globalvariables.h"
#include "src/installedlistfilter.h"
#include "src/installedlistmodel.h"
#include "src/monitorlistmodel.h"
#include "src/profilelistmodel.h"
#include "src/screenplaymanager.h"
#include "src/settings.h"
#include "src/util.h"
#include "src/wizards.h"
#include "ScreenPlay/create.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/installedlistfilter.h"
#include "ScreenPlay/installedlistmodel.h"
#include "ScreenPlay/monitorlistmodel.h"
#include "ScreenPlay/profilelistmodel.h"
#include "ScreenPlay/screenplaymanager.h"
#include "ScreenPlay/settings.h"
#include "ScreenPlay/util.h"
#include "ScreenPlay/wizards.h"
#include <memory>
#include <sentry.h>

View File

@ -57,9 +57,9 @@
#include <memory>
#include "ScreenPlayUtil/util.h"
#include "createimportvideo.h"
#include "globalvariables.h"
#include "util.h"
#include "ScreenPlay/createimportvideo.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/util.h"
namespace ScreenPlay {

View File

@ -49,8 +49,8 @@
#include <QString>
#include <QtMath>
#include "createimportstates.h"
#include "util.h"
#include "ScreenPlay/createimportstates.h"
#include "ScreenPlay/util.h"
namespace ScreenPlay {

View File

@ -38,8 +38,8 @@
#include <QSortFilterProxyModel>
#include <memory>
#include "globalvariables.h"
#include "installedlistmodel.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/installedlistmodel.h"
namespace ScreenPlay {

View File

@ -55,9 +55,9 @@
#include <QtConcurrent/QtConcurrent>
#include "ScreenPlayUtil/projectfile.h"
#include "globalvariables.h"
#include "profilelistmodel.h"
#include "util.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/profilelistmodel.h"
#include "ScreenPlay/util.h"
#include <memory>

View File

@ -43,9 +43,9 @@
#include <QString>
#include <QVector>
#include "projectsettingslistmodel.h"
#include "screenplaywallpaper.h"
#include "screenplaywidget.h"
#include "ScreenPlay/projectsettingslistmodel.h"
#include "ScreenPlay/screenplaywallpaper.h"
#include "ScreenPlay/screenplaywidget.h"
#ifdef Q_OS_WIN
#include <qt_windows.h>

View File

@ -43,8 +43,8 @@
#include <QUrl>
#include <QVector>
#include "globalvariables.h"
#include "profile.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/profile.h"
#include <memory>

View File

@ -43,7 +43,7 @@
#include <QJsonObject>
#include <QVector>
#include "util.h"
#include "ScreenPlay/util.h"
namespace ScreenPlay {

View File

@ -41,11 +41,11 @@
#include <memory>
#include "globalvariables.h"
#include "projectsettingslistmodel.h"
#include "sdkconnection.h"
#include "settings.h"
#include "util.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/projectsettingslistmodel.h"
#include "ScreenPlay/sdkconnection.h"
#include "ScreenPlay/settings.h"
#include "ScreenPlay/util.h"
namespace ScreenPlay {

View File

@ -43,9 +43,9 @@
#include <QProcess>
#include "ScreenPlayUtil/util.h"
#include "globalvariables.h"
#include "projectsettingslistmodel.h"
#include "sdkconnection.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/projectsettingslistmodel.h"
#include "ScreenPlay/sdkconnection.h"
#include <memory>
#include <utility>

View File

@ -47,8 +47,8 @@
#include <QWebSocketServer>
#include "ScreenPlayUtil/util.h"
#include "globalvariables.h"
#include "util.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/util.h"
#include <memory>

View File

@ -61,8 +61,8 @@
#include <QtConcurrent/QtConcurrent>
#include <QtGlobal>
#include "globalvariables.h"
#include "util.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/util.h"
#include <memory>
#include <optional>

View File

@ -54,7 +54,7 @@
#include <qqml.h>
#include "ScreenPlayUtil/util.h"
#include "globalvariables.h"
#include "ScreenPlay/globalvariables.h"
#include <fstream>
#include <iostream>

View File

@ -54,9 +54,9 @@
#include <QUrl>
#include <QtMath>
#include "createimportvideo.h"
#include "globalvariables.h"
#include "util.h"
#include "ScreenPlay/createimportvideo.h"
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/util.h"
#include <memory>
#include <optional>

View File

@ -32,7 +32,7 @@
**
****************************************************************************/
#include "app.h"
#include "ScreenPlay/app.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>

View File

@ -1,4 +1,4 @@
#include "app.h"
#include "ScreenPlay/app.h"
#include "steam/steam_qt_enums_generated.h"
#include <QProcessEnvironment>

View File

@ -1,4 +1,4 @@
#include "create.h"
#include "ScreenPlay/create.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "createimportvideo.h"
#include "ScreenPlay/createimportvideo.h"
#include "ScreenPlayUtil/util.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "globalvariables.h"
#include "ScreenPlay/globalvariables.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "installedlistfilter.h"
#include "ScreenPlay/installedlistfilter.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "installedlistmodel.h"
#include "ScreenPlay/installedlistmodel.h"
#include <QDebug>
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "monitorlistmodel.h"
#include "ScreenPlay/monitorlistmodel.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "profilelistmodel.h"
#include "ScreenPlay/profilelistmodel.h"
#include <QDirIterator>
#include <QFileInfoList>

View File

@ -1,4 +1,4 @@
#include "projectsettingslistmodel.h"
#include "ScreenPlay/projectsettingslistmodel.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "screenplaymanager.h"
#include "ScreenPlay/screenplaymanager.h"
#include <QScopeGuard>
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "screenplaywallpaper.h"
#include "ScreenPlay/screenplaywallpaper.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "screenplaywidget.h"
#include "ScreenPlay/screenplaywidget.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "sdkconnection.h"
#include "ScreenPlay/sdkconnection.h"
namespace ScreenPlay {

View File

@ -1,4 +1,4 @@
#include "settings.h"
#include "ScreenPlay/settings.h"
#include "ScreenPlayUtil/util.h"
#include <QFileInfo>

View File

@ -1,4 +1,4 @@
#include "util.h"
#include "ScreenPlay/util.h"
#include <sentry.h>

View File

@ -1,4 +1,4 @@
#include "wizards.h"
#include "ScreenPlay/wizards.h"
#include "ScreenPlayUtil/util.h"

View File

@ -32,8 +32,8 @@
**
****************************************************************************/
#include "app.h"
#include "create.h"
#include "ScreenPlay/app.h"
#include "ScreenPlay/create.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QCoreApplication>
@ -45,6 +45,7 @@
Q_IMPORT_QML_PLUGIN(ScreenPlayQmlPlugin)
Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin)
Q_IMPORT_QML_PLUGIN(ScreenPlayWorkshopPlugin)
class ScreenPlayTest : public QObject {
Q_OBJECT
@ -52,8 +53,7 @@ class ScreenPlayTest : public QObject {
private slots:
void initTestCase()
{
Q_INIT_RESOURCE(ScreenPlayQML);
Q_INIT_RESOURCE(ScreenPlayAssets);
Q_INIT_RESOURCE(Resources);
app.init();
m_window = qobject_cast<QQuickWindow*>(app.mainWindowEngine()->rootObjects().first());

View File

@ -23,20 +23,18 @@ set(SHADER
shaders/lightning.frag
shaders/wobble.frag
shaders/water.frag
shaders/water.vert
)
shaders/water.vert)
set(RESOURCES
assets/mask_01.png
assets/Shadertoy_Bayer.png
assets/Shadertoy_Gray_Noise_Medium.png
assets/Shadertoy_Lichen.jpg
assets/test_image_andras-vas-Bd7gNnWJBkU-unsplash.jpg
)
assets/test_image_andras-vas-Bd7gNnWJBkU-unsplash.jpg)
qt_add_library(${PROJECT_NAME} STATIC)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick)
target_include_directories(${PROJECT_NAME} PUBLIC src/ )
target_include_directories(${PROJECT_NAME} PUBLIC src/)
qt_add_qml_module(
${PROJECT_NAME}
@ -67,6 +65,6 @@ qt6_add_shaders(
if(${SCREENPLAY_TESTS})
qt_add_executable(tst_ScreenPlayShader src/TestMain.cpp)
target_link_libraries(tst_ScreenPlayShader PRIVATE Qt::Quick ${PROJECT_NAME}plugin )
target_link_libraries(tst_ScreenPlayShader PRIVATE Qt::Quick ${PROJECT_NAME}plugin)
target_compile_definitions(tst_ScreenPlayShader PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
endif()

View File

@ -41,7 +41,7 @@ Common.Dialog {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 150
Layout.preferredHeight: 150
source: "qrc:/ScreenPlayWorkshop/assets/icons/exclamation-triangle-solid.svg"
source: "qrc:/assets/icons/exclamation-triangle-solid.svg"
fillMode: Image.PreserveAspectFit
layer {

View File

@ -86,7 +86,6 @@ elseif(UNIX)
set(STEAM_BIN ${STEAM_LIB})
endif()
qt_add_library(${PROJECT_NAME} STATIC ${RESOURCES})
# Needed by the automatic generated target missing includes
# https://github.com/qt/qtdeclarative/blob/7a7064e14f094e843e1ee832cc927e86f887621a/src/qml/Qt6QmlMacros.cmake#L2042
@ -133,13 +132,13 @@ if(${SCREENPLAY_STEAM})
if(${SCREENPLAY_TESTS})
qt_add_executable(tst_ScreenPlayWorkshop src/TestMain.cpp)
target_link_libraries(tst_ScreenPlayWorkshop PRIVATE
Qt6::Quick
${PROJECT_NAME}plugin
ScreenPlayUtilplugin
SteamSDK
SteamSDKQtEnums)
target_link_libraries(
tst_ScreenPlayWorkshop
PRIVATE Qt6::Quick
${PROJECT_NAME}plugin
ScreenPlayUtilplugin
SteamSDK
SteamSDKQtEnums)
target_compile_definitions(tst_ScreenPlayWorkshop PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
endif()
endif()