Aggiunta script test compilazioni

This commit is contained in:
Samuele Locatelli
2026-05-22 11:00:19 +02:00
parent 83223d2dbd
commit 9cc6b853ec
+56
View File
@@ -0,0 +1,56 @@
# Cerca ricorsivamente solo le soluzioni che iniziano con 'IOB-WIN-'
$pattern = "IOB-WIN-*.sln"
$solutions = Get-ChildItem -Path . -Filter $pattern -Recurse
if ($solutions.Count -eq 0) {
Write-Host "⚠️ Nessuna soluzione trovata che corrisponde al pattern: $pattern" -ForegroundColor Yellow
Exit
}
Write-Host "🚀 Trovate $($solutions.Count) soluzioni da verificare." -ForegroundColor Magenta
# Inizializzazione variabili per il riepilogo
$successCount = 0
$failCount = 0
$failedSolutions = @()
foreach ($sol in $solutions) {
Write-Host "`n--------------------------------------------------" -ForegroundColor Cyan
Write-Host "Compilazione in corso: $($sol.Name)" -ForegroundColor White
Write-Host "--------------------------------------------------" -ForegroundColor Cyan
# Esegue la compilazione
dotnet build $sol.FullName --configuration Debug --no-incremental
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Errore nella compilazione di $($sol.Name)" -ForegroundColor Red
$failCount++
$failedSolutions += $sol.Name
}
else {
Write-Host "$($sol.Name) compilata con successo!" -ForegroundColor Green
$successCount++
}
}
# Determina il colore del testo per i fallimenti in modo retrocompatibile
$failColor = "Gray"
if ($failCount -gt 0) { $failColor = "Red" }
# --- RIEPILOGO FINALE ---
Write-Host "`n==================================================" -ForegroundColor Magenta
Write-Host " 🏁 Processo di verifica completato!" -ForegroundColor Magenta
Write-Host "==================================================" -ForegroundColor Magenta
Write-Host " Successi: $successCount" -ForegroundColor Green
Write-Host " Falliti: $failCount" -ForegroundColor $failColor
if ($failCount -gt 0) {
Write-Host "`n❌ Elenco delle soluzioni fallite:" -ForegroundColor Red
foreach ($failed in $failedSolutions) {
Write-Host " - $failed" -ForegroundColor Red
}
}
else {
Write-Host "`n🎉 Ottimo! Tutte le soluzioni sono state compilate senza errori." -ForegroundColor Green
}
Write-Host "==================================================" -ForegroundColor Magenta