:: ============================================================
:: FOR CONTRIBUTORS/EDITORS: DO NOT edit this file using the GitHub web
:: editor, "Edit in place", or any Mac/Linux text tool -- these silently
:: strip the CR half of this file's required Windows (CRLF) line endings.
:: This repo enforces CRLF via .gitattributes ("-text" for *.bat/*.cmd)
:: plus tools/check_crlf.py in CI -- edit only from a real Windows/CRLF
:: checkout, and run
:: `python tools/check_crlf.py --fix tests/dynamic_tests.bat` before
:: committing if unsure.
:: ============================================================
@echo off
setlocal DisableDelayedExpansion
cd /d "%~dp0"
set "LOG=~dynamic-run.log"
echo [%date% %time%] Dynamic tests starting... > "%LOG%"
set "CAND=%PUBLIC%\Documents\Miniconda3\python.exe"
if exist "%CAND%" ( set "PY=%CAND%" )
if not defined PY (
  where py >nul 2>&1 && ( for /f "usebackq delims=" %%A in (`py -3 -c "import sys; print(sys.executable)"`) do set "PY=%%A" )
)
if not defined PY (
  for %%P in (python.exe) do ( where %%P >nul 2>&1 && set "PY=%%P" )
)
if not defined PY (
  echo No Python interpreter found. Skipping dynamic tests. >> "%LOG%"
  echo No Python found. Skipping dynamic tests.
  exit /b 2
)
echo Using Python: %PY% >> "%LOG%"
"%PY%" dynamic_tests.py > "~dynamic-results.ndjson" 2>> "%LOG%"
set ERR=%ERRORLEVEL%
type "~dynamic-results.ndjson"
REM Entry-selection guardrail unittests (tests.test_entry_selection / tests.test_entry_single)
REM are developer-only and should be run manually via "python -m unittest".
echo Exit code: %ERR%
echo To bootstrap the app, double-click: ..\run_setup.bat
exit /b %ERR%
