%echo off
javac doall_password.java

rmdir ..\tests
mkdir ..\tests
pushd ..\tests

echo "[ Generate tests ]"

java -cp ..\src doall_password

pushd ..\solutions\
javac password_sm.java
popd

echo "[ Validating tests ]"
g++ ..\src\validate.cpp -o ..\src\validate.exe
for %%i in (??) do (
	..\src\validate.exe < %%i
	if errorlevel 1 (
		echo Validation failed, test %%i
		exit 1
	) else (
		echo %%i ok
	)
)
for %%i in (??)do (
	copy %%i password.in
	run java -cp ..\solutions password_sm
	copy password.out %%i.a
)

popd
