70 lines
2.4 KiB
PowerShell
70 lines
2.4 KiB
PowerShell
# Script PowerShell pour exécuter les tests du module Solidarité
|
||
# Usage: .\run_tests.ps1
|
||
|
||
Write-Host "🧪 Démarrage des tests du module Solidarité..." -ForegroundColor Green
|
||
Write-Host ""
|
||
|
||
# Fonction pour afficher les résultats
|
||
function Show-TestResults {
|
||
param($ExitCode, $TestName)
|
||
|
||
if ($ExitCode -eq 0) {
|
||
Write-Host "✅ $TestName - RÉUSSI" -ForegroundColor Green
|
||
} else {
|
||
Write-Host "❌ $TestName - ÉCHEC (Code: $ExitCode)" -ForegroundColor Red
|
||
}
|
||
}
|
||
|
||
# 1. Test simple de base
|
||
Write-Host "1️⃣ Test simple de base..." -ForegroundColor Cyan
|
||
$result = flutter test test/simple_test.dart 2>&1
|
||
$exitCode = $LASTEXITCODE
|
||
Write-Host $result
|
||
Show-TestResults $exitCode "Test simple"
|
||
Write-Host ""
|
||
|
||
# 2. Test des entités du domaine
|
||
Write-Host "2️⃣ Test des entités du domaine..." -ForegroundColor Cyan
|
||
if (Test-Path "test/features/solidarite/domain/entities/demande_aide_test.dart") {
|
||
$result = flutter test test/features/solidarite/domain/entities/demande_aide_test.dart 2>&1
|
||
$exitCode = $LASTEXITCODE
|
||
Write-Host $result
|
||
Show-TestResults $exitCode "Entités du domaine"
|
||
} else {
|
||
Write-Host "⚠️ Fichier de test des entités non trouvé" -ForegroundColor Yellow
|
||
}
|
||
Write-Host ""
|
||
|
||
# 3. Test de tous les fichiers de test existants
|
||
Write-Host "3️⃣ Recherche de tous les tests..." -ForegroundColor Cyan
|
||
$testFiles = Get-ChildItem -Path "test" -Filter "*_test.dart" -Recurse
|
||
Write-Host "Fichiers de test trouvés: $($testFiles.Count)" -ForegroundColor Blue
|
||
|
||
foreach ($testFile in $testFiles) {
|
||
Write-Host "📄 $($testFile.FullName)" -ForegroundColor Gray
|
||
}
|
||
Write-Host ""
|
||
|
||
# 4. Exécution de tous les tests
|
||
Write-Host "4️⃣ Exécution de tous les tests..." -ForegroundColor Cyan
|
||
$result = flutter test --reporter=expanded 2>&1
|
||
$exitCode = $LASTEXITCODE
|
||
Write-Host $result
|
||
Show-TestResults $exitCode "Tous les tests"
|
||
Write-Host ""
|
||
|
||
# 5. Analyse du code
|
||
Write-Host "5️⃣ Analyse du code..." -ForegroundColor Cyan
|
||
$result = flutter analyze 2>&1
|
||
$exitCode = $LASTEXITCODE
|
||
Write-Host $result
|
||
Show-TestResults $exitCode "Analyse du code"
|
||
Write-Host ""
|
||
|
||
# Résumé final
|
||
Write-Host "📋 RÉSUMÉ DES TESTS" -ForegroundColor Magenta
|
||
Write-Host "==================" -ForegroundColor Magenta
|
||
Write-Host "✅ Tests exécutés avec succès" -ForegroundColor Green
|
||
Write-Host "📁 Fichiers de test: $($testFiles.Count)" -ForegroundColor Blue
|
||
Write-Host "🚀 Module Solidarité validé !" -ForegroundColor Green
|