From f6d39afe291aab3988ecb13caa55ad4e9e93c5f7 Mon Sep 17 00:00:00 2001 From: mistangl Date: Fri, 30 Jan 2026 18:59:33 +0100 Subject: [PATCH] impl. unittests werden per bat aufgerufen. --- bin/run_unittests.bat | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 bin/run_unittests.bat diff --git a/bin/run_unittests.bat b/bin/run_unittests.bat new file mode 100644 index 0000000..b937e30 --- /dev/null +++ b/bin/run_unittests.bat @@ -0,0 +1,38 @@ +@echo off +CALL setenv.bat + +echo ======================================== +echo running all unittests in lib\Elemente +echo ======================================== +echo. +CALL manage_interpreter.bat activate +if %ERRORLEVEL% NEQ 0 ( + echo. + echo Failed to activate the Python interpreter! + pause + exit /B 1 +) +echo Gefundene Testdateien: +for /f "delims=" %%f in ('dir /b "%PROJECT_LIB%\*_tests.py" 2^>nul') do echo %%f +echo. +pushd "%PROJECT%" +if errorlevel 1 ( + echo ERROR: Failed to change to project directory: %PROJECT% + CALL manage_interpreter.bat deactivate + exit /b 1 +) +"%VIRTUAL_ENV%\Scripts\python.exe" -m unittest discover -t "%PROJECT%" -s lib -p "*_test.py" -v +set TEST_EXIT=%ERRORLEVEL% +popd +if %TEST_EXIT% NEQ 0 ( + echo. + echo Tests failed! + CALL manage_interpreter.bat deactivate + exit /B 1 +) else ( + echo. + echo All tests passed! + CALL manage_interpreter.bat deactivate + exit /B 0 +) +