# test_repro_partener_scc_null.ps1 - rulare headless (fara harness/screenshots) a testului de
# reproducere pentru dublu click pe "Partener credit" cu contul creditor NULL.
# Rulare:  powershell -ExecutionPolicy Bypass -File test_repro_partener_scc_null.ps1
$ErrorActionPreference = 'Stop'
$Teste = $PSScriptRoot
$Prg = Join-Path $Teste 'test_repro_partener_scc_null.prg'
$Fxp = [IO.Path]::ChangeExtension($Prg, '.fxp')
$Log = Join-Path $Teste 'test_repro_partener_scc_null_log.txt'
$Vfp = 'C:\Program Files (x86)\Microsoft Visual FoxPro 9\vfp9.exe'

Remove-Item $Fxp, $Log -ErrorAction SilentlyContinue
$p = Start-Process -FilePath $Vfp -ArgumentList '-A', '-T', "`"$Prg`"" -PassThru
if (-not $p.WaitForExit(240000)) {
    $p.Kill()
    throw 'TIMEOUT: testul nu s-a terminat in 240s'
}
if (-not (Test-Path $Log)) { throw "Lipseste logul $Log" }
Get-Content $Log
