mirror of
https://github.com/jellyfin/jellyfin-desktop.git
synced 2026-10-26 16:45:24 +00:00
Add test runner scripts (#1171)
This commit is contained in:
1 parent
b582091e9b
commit
134d43352b
8 files changed
+78
-20
No files matched your search
+10
-1
@@ -2,10 +2,18 @@
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Setup and build
|
||||
```bash
|
||||
dev/macos/setup.sh # First time: install dependencies
|
||||
dev/macos/build.sh # Build
|
||||
dev/macos/run.sh # Run
|
||||
```
|
||||
### Run the application
|
||||
```bash
|
||||
dev/macos/run.sh
|
||||
```
|
||||
### Run the unit tests
|
||||
```bash
|
||||
dev/macos/test.sh
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
@@ -31,6 +39,7 @@ dev/macos/run.sh # Run
|
||||
- `build.sh` - Configure and build
|
||||
- `bundle.sh` - Create DMG for distribution
|
||||
- `run.sh` - Run the built app (passes arguments through)
|
||||
- `test.sh` - Run unit tests (sets up Qt/mpv in PATH)
|
||||
- `common.sh` - Shared variables (sourced by other scripts)
|
||||
|
||||
## Clean Build
|
||||
|
||||
@@ -9,3 +9,18 @@ PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
|
||||
DEPS_DIR="${SCRIPT_DIR}/deps"
|
||||
BUILD_DIR="${PROJECT_ROOT}/build"
|
||||
APP_NAME="Jellyfin Desktop.app"
|
||||
|
||||
# Setup runtime environment for Qt libs from aqt installation (unbundled dev build).
|
||||
# Call from run.sh / test.sh after sourcing this file.
|
||||
setup_runtime() {
|
||||
QTROOT="${DEPS_DIR}/qt/${QT_VERSION}/macos"
|
||||
|
||||
if [ ! -d "${BUILD_DIR}" ]; then
|
||||
echo "error: Build not found. Run build.sh first" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export DYLD_FRAMEWORK_PATH="${QTROOT}/lib"
|
||||
export QT_PLUGIN_PATH="${QTROOT}/plugins"
|
||||
export QML_IMPORT_PATH="${QTROOT}/qml"
|
||||
}
|
||||
+3
-8
@@ -5,18 +5,13 @@ set -eu
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
|
||||
. "${SCRIPT_DIR}/common.sh"
|
||||
setup_runtime
|
||||
|
||||
QTROOT="${DEPS_DIR}/qt/${QT_VERSION}/macos"
|
||||
APP_PATH="${BUILD_DIR}/src/${APP_NAME}"
|
||||
|
||||
# Check build exists
|
||||
if [ ! -d "${APP_PATH}" ]; then
|
||||
echo "error: Build not found. Run build.sh first" >&2
|
||||
echo "error: App bundle not found at ${APP_PATH}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run with Qt libs from aqt installation (unbundled dev build)
|
||||
export DYLD_FRAMEWORK_PATH="${QTROOT}/lib"
|
||||
export QT_PLUGIN_PATH="${QTROOT}/plugins"
|
||||
export QML_IMPORT_PATH="${QTROOT}/qml"
|
||||
exec "${APP_PATH}/Contents/MacOS/Jellyfin Desktop" "${@}"
|
||||
exec "${APP_PATH}/Contents/MacOS/Jellyfin Desktop" ${1+"$@"}
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env sh
|
||||
# Jellyfin Desktop - Run unit tests
|
||||
# Run build.sh first
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
|
||||
. "${SCRIPT_DIR}/common.sh"
|
||||
setup_runtime
|
||||
|
||||
cd "${BUILD_DIR}"
|
||||
ctest --output-on-failure "$@"
|
||||
+10
-1
@@ -2,10 +2,18 @@
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Setup and build
|
||||
```cmd
|
||||
dev\windows\setup.bat # First time: download dependencies
|
||||
dev\windows\build.bat # Build
|
||||
dev\windows\run.bat # Run
|
||||
```
|
||||
### Run the application
|
||||
```cmd
|
||||
dev\windows\run.bat
|
||||
```
|
||||
### Run the unit tests
|
||||
```cmd
|
||||
dev\windows\test.bat
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
@@ -31,6 +39,7 @@ dev\windows\run.bat # Run
|
||||
- `build.bat` - Configure and build
|
||||
- `bundle.bat` - Create installer and portable ZIP
|
||||
- `run.bat` - Run executable (sets up Qt/mpv in PATH)
|
||||
- `test.bat` - Run unit tests (sets up Qt/mpv in PATH)
|
||||
- `common.bat` - Shared variables (sourced by other scripts)
|
||||
|
||||
## Clean Build
|
||||
|
||||
@@ -24,3 +24,17 @@ if not defined VCVARS if exist "%VS_CM%" set "VCVARS=%VS_CM%"
|
||||
if not defined VCVARS if exist "%VS_PR%" set "VCVARS=%VS_PR%"
|
||||
if not defined VCVARS if exist "%VS_EN%" set "VCVARS=%VS_EN%"
|
||||
if not defined VCVARS if exist "%VS_BT86%" set "VCVARS=%VS_BT86%"
|
||||
|
||||
if "%~1"=="" goto :eof
|
||||
goto %~1
|
||||
|
||||
REM === Setup runtime PATH for DLLs ===
|
||||
REM Call with: call "%~dp0common.bat" :setup_runtime
|
||||
:setup_runtime
|
||||
if not exist "%BUILD_DIR%" (
|
||||
echo ERROR: Build not found. Run build.bat first
|
||||
exit /b 1
|
||||
)
|
||||
set "PATH=%DEPS_DIR%\mpv;%PATH%"
|
||||
set "PATH=%DEPS_DIR%\qt\%QT_VERSION%\msvc2022_64\bin;%PATH%"
|
||||
goto :eof
|
||||
+1
-10
@@ -4,16 +4,7 @@ REM Run build.bat first
|
||||
|
||||
setlocal
|
||||
call "%~dp0common.bat"
|
||||
|
||||
REM === Check build exists ===
|
||||
if not exist "%BUILD_DIR%\src\%EXE_NAME%" (
|
||||
echo ERROR: Build not found. Run build.bat first
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM === Setup PATH for DLLs ===
|
||||
set "PATH=%DEPS_DIR%\mpv;%PATH%"
|
||||
set "PATH=%DEPS_DIR%\qt\%QT_VERSION%\msvc2022_64\bin;%PATH%"
|
||||
call "%~dp0common.bat" :setup_runtime || exit /b 1
|
||||
|
||||
REM === Run ===
|
||||
"%BUILD_DIR%\src\%EXE_NAME%" %*
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
REM Jellyfin Desktop - Run unit tests
|
||||
REM Run build.bat first
|
||||
|
||||
setlocal
|
||||
call "%~dp0common.bat"
|
||||
call "%~dp0common.bat" :setup_runtime || exit /b 1
|
||||
|
||||
REM === Run tests ===
|
||||
cd /d "%BUILD_DIR%"
|
||||
ctest --output-on-failure %*
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
|
||||
endlocal & exit /b %EXIT_CODE%
|
||||
Reference in new issue
Block a user