@ECHO OFF
SETLOCAL

IF NOT EXIST testOut\ mkdir testOut

SET PROG=tclsh ..\poApps.tcl
IF NOT "%1"=="" SET PROG=%1

SET OPT=--filediff --verbose --batch --nosaveonexit --config ConfigDir

ECHO %PROG% %OPT% testIn\TextFile1Dos.txt testIn\TextFile1Dos.txt
CALL %PROG% %OPT% testIn\TextFile1Dos.txt testIn\TextFile1Dos.txt
IF NOT "%ERRORLEVEL%"=="0" ECHO ErrorCode identical files: %ERRORLEVEL%

ECHO %PROG% %OPT% testIn\TextFile1Dos.txt testIn\TextFile1Unix.txt
CALL %PROG% %OPT% testIn\TextFile1Dos.txt testIn\TextFile1Unix.txt
IF NOT "%ERRORLEVEL%"=="1" ECHO ErrorCode identical files (EOL different): %ERRORLEVEL%

ECHO %PROG% %OPT% --ignoreeol true testIn\TextFile1Dos.txt testIn\TextFile1Unix.txt
CALL %PROG% %OPT% --ignoreeol true testIn\TextFile1Dos.txt testIn\TextFile1Unix.txt
IF NOT "%ERRORLEVEL%"=="0" ECHO ErrorCode identical files (EOL different): %ERRORLEVEL%

ECHO %PROG% %OPT% testIn\TextFile1Dos.txt testIn\TextFile2Dos.txt
CALL %PROG% %OPT% testIn\TextFile1Dos.txt testIn\TextFile2Dos.txt
IF NOT "%ERRORLEVEL%"=="1" ECHO ErrorCode different files: %ERRORLEVEL%

ECHO %PROG% %OPT% testIn\Encoding-utf8.txt testIn\Encoding-iso8859.txt
CALL %PROG% %OPT% testIn\Encoding-utf8.txt testIn\Encoding-iso8859.txt
IF NOT "%ERRORLEVEL%"=="1" ECHO ErrorCode files with different encodings: %ERRORLEVEL%

