@echo off

set problem=parade
set author=sm

echo Generating tests...
cd src
javac gen_parade.java
java -ea gen_parade
cd ..

call javac -classpath ../../lib/testlib4j.jar Check.java -encoding utf8 
call jar cf Check.jar *.class

echo Generating answers...

javac %problem%_%author%.java -encoding utf8

for %%i in (tests\??) do (
	echo Test %%i
	copy %%i %problem%.in > nul
	java -Xmx256M -Xss64M %problem%_%author%
	copy %problem%.out %%i.a > nul
	echo Check %%i
	java -Xmx256M -Xss64M -cp ../../lib/testlib4j.jar;Check.jar ru.ifmo.testlib.CheckerFramework Check %%i %%i.a %%i.a
)
