Files
dxdesigner-part-replacement/tools/Test-V1.1.ps1

23 lines
895 B
PowerShell

[CmdletBinding()]
param([string]$PythonExecutable = 'python', [switch]$Safety)
$ErrorActionPreference = 'Stop'
$testRepository = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '..')).Path
$testPreviousPythonPath = $env:PYTHONPATH
$testPreviousQtPlatform = $env:QT_QPA_PLATFORM
try {
$env:PYTHONPATH = Join-Path $testRepository 'src'
$env:QT_QPA_PLATFORM = 'offscreen'
Push-Location $testRepository
if ($Safety) {
& $PythonExecutable -m pytest -q tests/v1_1 tests/part_replace/test_verification.py tests/trial_task_center/test_execution_safety.py tests/trial_task_center/test_application.py --durations=5
} else {
& $PythonExecutable -m pytest -q tests/v1_1 --durations=5
}
$testResult = $LASTEXITCODE
} finally {
Pop-Location
$env:PYTHONPATH = $testPreviousPythonPath
$env:QT_QPA_PLATFORM = $testPreviousQtPlatform
}
exit $testResult