28 lines
870 B
Batchfile
28 lines
870 B
Batchfile
@echo off
|
|
echo Running all tests with coverage...
|
|
|
|
:: Esegue pytest, calcola la copertura per il pacchetto 'target_simulator'
|
|
:: e genera un report HTML nella cartella 'htmlcov'
|
|
::pytest --cov=target_simulator --cov-report=html
|
|
pytest --cov=target_simulator --cov-report=term-missing --cov-report=html -q
|
|
|
|
:: Controlla se il comando precedente ha avuto successo
|
|
if %errorlevel% neq 0 (
|
|
echo.
|
|
echo TESTS FAILED! See the output above for details.
|
|
start htmlcov/index.html
|
|
exit /b %errorlevel%
|
|
)
|
|
|
|
echo.
|
|
echo ================================================
|
|
echo TESTS PASSED!
|
|
echo Coverage report generated in 'htmlcov' folder.
|
|
echo ================================================
|
|
echo.
|
|
|
|
:: (Opzionale) Apri automaticamente il report nel browser predefinito
|
|
:: Decommenta la riga seguente se vuoi questo comportamento
|
|
start htmlcov/index.html
|
|
|
|
echo Done. |