2017-04-06 12:25:16 +03:00
|
|
|
# Diagnostic
|
|
|
|
function Write-Diagnostic {
|
|
|
|
param([string]$message)
|
|
|
|
|
|
|
|
Write-Host
|
|
|
|
Write-Host -f green $message
|
|
|
|
Write-Host
|
|
|
|
}
|
|
|
|
|
|
|
|
function Die([string]$message, [object[]]$output) {
|
|
|
|
if ($output) { Write-Output $output }
|
|
|
|
Write-Error $message
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2017-04-15 14:37:26 +03:00
|
|
|
function Test([string]$projectpath) {
|
|
|
|
Write-Diagnostic "Testing $projectpath ..."
|
|
|
|
dotnet test .\src\Tests\$projectpath\$projectpath.csproj
|
|
|
|
if($LASTEXITCODE -ne 0) { Die("$projectpath failed.") }
|
|
|
|
}
|
|
|
|
|
2018-10-08 00:20:39 +03:00
|
|
|
.\build\build.ps1 -version "$env:PackageVersion" -config "$env:Configuration"
|
2017-04-06 12:25:16 +03:00
|
|
|
if($LASTEXITCODE -ne 0) { Die("Build failed.") }
|
|
|
|
|
2017-04-15 14:37:26 +03:00
|
|
|
Test "Peachpie.ScriptTests"
|
|
|
|
Test "Peachpie.DiagnosticTests"
|
2017-04-06 12:25:16 +03:00
|
|
|
|
|
|
|
Write-Diagnostic "Succeeded."
|