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

Add doctest and google benchmark

This commit is contained in:
Elias Steurer 2020-10-30 15:37:00 +01:00
parent 92e781afc9
commit 536d2623c1
5 changed files with 59 additions and 5 deletions

View File

@ -91,6 +91,41 @@ build:linux_release:
paths:
- build-x64-linux-release/bin/
test:windows_debug:
stage: test
tags:
- windows10
- vs2019
dependencies:
- build:windows_debug
needs:
- build:windows_debug
script:
- ./build-x64-window-debug/bin/ScreenPlay.exe --no-run=false --exit=true --reporters=junit --out=test-report-junit.xml
artifacts:
expire_in: '4 weeks'
when: always
reports:
junit: test-report-junit.xml
test:windows_release:
stage: test
tags:
- windows10
- vs2019
dependencies:
- build:windows_release
needs:
- build:windows_release
script:
- ./build-x64-window-release/bin/ScreenPlay.exe --no-run=false --exit=true --reporters=junit --out=test-report-junit.xml
artifacts:
expire_in: '4 weeks'
when: always
reports:
junit: test-report-junit.xml
build_docs:
stage: .post

View File

@ -11,6 +11,9 @@ find_package(
REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(benchmark CONFIG REQUIRED)
find_package(doctest CONFIG REQUIRED)
if(WIN32)
find_package(sentry CONFIG REQUIRED)
endif()
@ -86,7 +89,17 @@ endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE "GIT_VERSION=${GIT_VERSION}")
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK)
target_link_libraries(
${PROJECT_NAME}
PRIVATE Qt5::Quick
Qt5::Gui
Qt5::Widgets
Qt5::Core
Qt5::WebEngine
ScreenPlaySDK
benchmark::benchmark
benchmark::benchmark_main
doctest::doctest)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry)

View File

@ -1,5 +1,6 @@
#include "screenplaymanager.h"
#include <QScopeGuard>
#include <doctest/doctest.h>
namespace ScreenPlay {
@ -18,7 +19,6 @@ namespace ScreenPlay {
ScreenPlayManager::ScreenPlayManager(
QObject* parent)
: QObject { parent }
, m_server { std::make_unique<QLocalServer>() }
{
@ -593,4 +593,10 @@ void ScreenPlayManager::loadProfiles()
}
}
TEST_CASE("Loads profiles.json")
{
GlobalVariables globalVariables;
ScreenPlayManager manager;
}
}

View File

@ -12,7 +12,7 @@ chmod +x bootstrap-vcpkg.sh
chmod +x vcpkg
if [[ "$OSTYPE" == "darwin"* ]]; then
./vcpkg install openssl-unix sentry-native --triplet x64-osx --recurse
./vcpkg install openssl-unix sentry-native doctest benchmark --triplet x64-osx --recurse
else
./vcpkg install openssl-unix sentry-native --triplet x64-linux --recurse
./vcpkg install openssl-unix sentry-native doctest benchmark --triplet x64-linux --recurse
fi

View File

@ -10,7 +10,7 @@ git checkout 18ab4b72a26284f0df28295ce7bf9b21c96f20f4
call bootstrap-vcpkg.bat
rem Install vcpkg dependencies
vcpkg.exe install openssl sentry-native --triplet x64-windows --recurse
vcpkg.exe install openssl sentry-native doctest benchmark --triplet x64-windows --recurse
cd ..
cd ScreenPlay