@echo off

echo Compiling generator...
javac TestsGen.java

echo Generating tests...
for %%i in (??.t) do (
  copy %%i %%~ni > nul
)

java TestsGen 2 tests.lst
del TestsGen.class

cd ..
dcc32 -cc check.dpr
cd tests

echo Generating answers...
call tall dp

echo Checking answers...
call docheck dp

cd ..
for %%i in (*.exe *.~dpr *.dof *.dsk *.cfg *.in *.out *.a *.obj ?? *.class) do del %%i
dcc32 -cc check.dpr
cd tests
