@ECHO OFF
SETLOCAL

IF NOT EXIST testOut\ mkdir testOut

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

SET OPT=--verbose --nosaveonexit --config ConfigDir
SET DIR=testin/RayTraceWindows
SET FILE=testIn/MyPalette.xml

ECHO %PROG% %OPT% --gzip testOut/File_Lev9.tgz --gziplevel 9 %FILE%
CALL %PROG% %OPT% --gzip testOut/File_Lev9.tgz --gziplevel 9 %FILE%
IF NOT "%ERRORLEVEL%"=="0" ECHO ErrorCode compressing file: %ERRORLEVEL%

ECHO %PROG% %OPT% --gzip testOut/Dir_Lev9.tgz --gziplevel 9 %DIR%
CALL %PROG% %OPT% --gzip testOut/Dir_Lev9.tgz --gziplevel 9 %DIR%
IF NOT "%ERRORLEVEL%"=="0" ECHO ErrorCode compressing directory: %ERRORLEVEL%

ECHO %PROG% %OPT% --gzip testOut/DirFile_Lev0.tar --gziplevel 0 %DIR% %FILE%
CALL %PROG% %OPT% --gzip testOut/DirFile_Lev0.tar --gziplevel 0 %DIR% %FILE%
IF NOT "%ERRORLEVEL%"=="0" ECHO ErrorCode compressing directory and file: %ERRORLEVEL%

ECHO %PROG% %OPT% --gzip testOut/NotExistingFile.tgz NotExistingFile
CALL %PROG% %OPT% --gzip testOut/File_Lev9.tgz NotExistingFile
IF NOT "%ERRORLEVEL%"=="1" ECHO ErrorCode not-existing file: %ERRORLEVEL%

