This commit is contained in:
Madzone
2026-10-09 14:50:28 +02:00
parent afbad0cb50
commit 2500b1f354
16 changed files with 1859 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
$ErrorActionPreference='Stop'
$preScript=Join-Path (Split-Path $PSScriptRoot -Parent) 'PreScript.ps1'
$root=Join-Path ([IO.Path]::GetTempPath()) ('ndtrack-pre-'+[guid]::NewGuid().ToString('N'))
$program=(Get-Process -Id $PID).Path
try {
& $program -NoProfile -File $preScript -BasePath $root
if($LASTEXITCODE -ne 1){throw 'Fehlende Ordner akzeptiert'}
if(Test-Path -LiteralPath $root){throw 'PreScript hat Ordner angelegt'}
foreach($relative in @('SCRIPT','NDTRACK','RESULTS','SCRIPT/Logs')){
New-Item -Path (Join-Path $root $relative) -ItemType Directory -Force | Out-Null
}
& $program -NoProfile -File $preScript -BasePath $root
if($LASTEXITCODE -ne 1){throw 'Leeres Paket akzeptiert'}
# Harmloses Test-Hauptskript dokumentiert nur seinen Start.
$fixture='Set-Content -LiteralPath (Join-Path $PSScriptRoot "started.txt") -Value "started"'
$main=Join-Path $root 'SCRIPT/NDTrack-Geprueft.ps1'
$marker=Join-Path $root 'SCRIPT/started.txt'
Set-Content -LiteralPath $main -Value $fixture
Set-Content -LiteralPath (Join-Path $root 'NDTRACK/RunNdTrackWindows_Local.cmd') -Value '@echo test'
& $program -NoProfile -File $preScript -BasePath $root
if($LASTEXITCODE -ne 0 -or -not(Test-Path -LiteralPath $marker)){throw 'Hauptskript nicht gestartet'}
Remove-Item -LiteralPath $marker
& $program -NoProfile -File $preScript -BasePath $root -Platform Both
if($LASTEXITCODE -ne 1 -or (Test-Path -LiteralPath $marker)){throw 'Start trotz fehlender Linux-Datei'}
Set-Content -LiteralPath (Join-Path $root 'NDTRACK/RunNdTrackLinuxUnix_Local.sh') -Value '#!/bin/sh'
& $program -NoProfile -File $preScript -BasePath $root -Platform Both
if($LASTEXITCODE -ne 0 -or -not(Test-Path -LiteralPath $marker)){throw 'Start fuer beide Plattformen fehlgeschlagen'}
Remove-Item -LiteralPath $marker
Set-Content -LiteralPath $main -Value 'function Broken {'
& $program -NoProfile -File $preScript -BasePath $root
if($LASTEXITCODE -ne 1 -or (Test-Path -LiteralPath $marker)){throw 'Syntaxfehler akzeptiert'}
Write-Host 'PreScript: 6 Szenarien bestanden; fehlende Ordner nicht angelegt; Hauptskript nur bei Erfolg gestartet.'
} finally { if(Test-Path -LiteralPath $root){Remove-Item -LiteralPath $root -Recurse -Force} }