Skip to content

Commit

Permalink
delete hard-coded file names in bash,bat,src,groovy for regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jyganci authored and adelosa committed Oct 8, 2023
1 parent 7dc087e commit fb5b5aa
Show file tree
Hide file tree
Showing 9 changed files with 228 additions and 397 deletions.
18 changes: 11 additions & 7 deletions bash/runcbldemos
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@ set -e # exit on all errors
cd $(dirname $0) # set to directory of script
cd ..

bash/cblclg zcobol/demo/HELLO $1 $2 $3 $4 $5 $6 $7 $8 $9
demopath=zcobol/demo

bash/cblclg ${demopath}/HELLO $1 $2 $3 $4 $5 $6 $7 $8 $9
echo "Verify Hello World"

bash/cblclg zcobol/demo/DATETIME $1 $2 $3 $4 $5 $6 $7 $8 $9
bash/cblclg ${demopath}/DATETIME $1 $2 $3 $4 $5 $6 $7 $8 $9
echo "Verify date and time"

bash/cblclg zcobol/demo/POWERS $1 $2 $3 $4 $5 $6 $7 $8 $9
bash/cblclg ${demopath}/POWERS $1 $2 $3 $4 $5 $6 $7 $8 $9
echo "Verify powers"

bash/cblclg zcobol/demo/COPYFILE $1 $2 $3 $4 $5 $6 $7 $8 $9
echo "Verify zcobol/demo/COPYFILE.IN was copied to zcobol/demo/COPYFILE.OUT"
export INFILE=${demopath}/COPYFILE.IN
export OUTFILE=${demopath}/COPYFILE.OUT
bash/cblclg ${demopath}/COPYFILE $1 $2 $3 $4 $5 $6 $7 $8 $9
echo "Verify ${demopath}/COPYFILE.IN was copied to ${demopath}/COPYFILE.OUT"

bash/cblc zcobol/demo/COMPSUM $1 $2 $3 $4 $5 $6 $7 $8 $9
bash/cblc ${demopath}/COMPSUM $1 $2 $3 $4 $5 $6 $7 $8 $9
echo "Verify successful compile of COMPSUM"

sys390='sys390(zcobol/lib)'

bash/asmlg zcobol/demo/CALLCOMP $sys390 $1 $2 $3 $4 $5 $6 $7 $8 $9
bash/asmlg ${demopath}/CALLCOMP $sys390 $1 $2 $3 $4 $5 $6 $7 $8 $9
echo "Verify CALLCOMP"
echo "Verify ZCOBOL demos"
64 changes: 49 additions & 15 deletions bash/runcmdproc
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,35 @@
# debug flag; 0=no debug, 1=debug
debug=0

set -e # exit on all errors
#set -e # exit on all errors
cd $(dirname $0) # set to directory of script
cd ..

########################################
# path
########################################

rtpath=rt/test

# Test one Command Processor

bash/asmlg rt/test/TESTCMD3
program=TESTCMD3

# build test program
bash/asml ${rtpath}/${program}
rc=$?
if [ $debug -eq 1 ]; then echo "TESTCMD3: rc=$rc"; fi
if [ $debug -eq 1 ]; then echo "build ${program}: rc=$rc"; fi
if [ "$rc" -ne "0" ]; then
echo "Error in TESTCMD3 rc=$rc - exiting"
echo "Error building ${program} rc=$rc - exiting"
exit $rc
fi

# name of test file
export TESTCMDFILE=${rtpath}/bash/testcmd3

bash/exec ${rtpath}/${program}
if [ "$rc" -ne "0" ]; then
echo "Error ${program} rc=$rc - exiting"
exit $rc
fi

Expand All @@ -42,27 +60,43 @@ fi
# 2. Second CP has more lines of output
# 3. First CP has more lines of output

bash/asmlg rt/test/TESTCMD4 'PARM(1)'
program=TESTCMD4

# build test program
bash/asml ${rtpath}/${program}
rc=$?
if [ $debug -eq 1 ]; then echo "TESTCMD4 PARM(1): rc=$rc"; fi
if [ $debug -eq 1 ]; then echo "build ${program}: rc=$rc"; fi
if [ "$rc" -ne "0" ]; then
echo "Error in TESTCMD4 PARM(1) rc=$rc - exiting"
echo "Error building ${program} rc=$rc - exiting"
exit $rc
fi

bash/asmlg rt/test/TESTCMD4 'PARM(2)'
rc=$?
if [ $debug -eq 1 ]; then echo "TESTCMD4 PARM(2): rc=$rc"; fi
# names of test files for first test
export TESTCMDFILE1=${rtpath}/bash/testcmd4a
export TESTCMDFILE2=${rtpath}/bash/testcmd4b

bash/exec ${rtpath}/${program} noinit dump
if [ "$rc" -ne "0" ]; then
echo "Error in TESTCMD4 PARM(2) rc=$rc - exiting"
echo "Error ${program} rc=$rc - exiting"
exit $rc
fi

bash/asmlg rt/test/TESTCMD4 'PARM(3)'
rc=$?
if [ $debug -eq 1 ]; then echo "TESTCMD4 PARM(3): rc=$rc"; fi
# names of test files for second test
export TESTCMDFILE1=${rtpath}/bash/testcmd4a
export TESTCMDFILE2=${rtpath}/bash/testcmd4c

bash/exec ${rtpath}/${program} noinit dump
if [ "$rc" -ne "0" ]; then
echo "Error ${program} rc=$rc - exiting"
exit $rc
fi

# names of test files for third test
export TESTCMDFILE1=${rtpath}/bash/testcmd4c
export TESTCMDFILE2=${rtpath}/bash/testcmd4b
bash/exec ${rtpath}/${program} noinit dump
if [ "$rc" -ne "0" ]; then
echo "Error in TESTCMD4 PARM(3) rc=$rc - exiting"
echo "Error ${program} rc=$rc - exiting"
exit $rc
fi

Expand Down
19 changes: 13 additions & 6 deletions bat/RUNCBLDEMOS.BAT
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ set /A z_NestLevel=%z_NestLevel%+1
rem ----- Lvl(%z_NestLevel%) Start %0 %1 %2 %3 %4 %5 %6 %7 %8 %9

pushd %~dps0..
call bat\CBLCLG %z_TraceMode% zcobol\demo\HELLO %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\CBLCLG %z_TraceMode% zcobol\demo\DATETIME %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\CBLCLG %z_TraceMode% zcobol\demo\POWERS %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\CBLCLG %z_TraceMode% zcobol\demo\COPYFILE %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\CBLC %z_TraceMode% zcobol\demo\COMPSUM %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\ASMLG %z_TraceMode% zcobol\demo\CALLCOMP SYS390(zcobol\lib) %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error

set DEMOPATH=zcobol\demo

call bat\CBLCLG %z_TraceMode% %DEMOPATH%\HELLO %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\CBLCLG %z_TraceMode% %DEMOPATH%\DATETIME %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\CBLCLG %z_TraceMode% %DEMOPATH%\POWERS %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error

set INFILE=%DEMOPATH%\COPYFILE.IN
set OUTFILE=%DEMOPATH%\COPYFILE.OUT

call bat\CBLCLG %z_TraceMode% %DEMOPATH%\COPYFILE %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\CBLC %z_TraceMode% %DEMOPATH%\COMPSUM %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
call bat\ASMLG %z_TraceMode% %DEMOPATH%\CALLCOMP SYS390(zcobol\lib) %1 %2 %3 %4 %5 %6 %7 %8 %9 || goto error
set z_ReturnCode=0
goto return

Expand Down
29 changes: 25 additions & 4 deletions bat/RUNCMDPROC.BAT
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,42 @@ rem ----- Lvl(%z_NestLevel%) Start %0 %1 %2 %3 %4 %5 %6 %7 %8 %9

pushd %~dps0..

set RTPATH=rt\test

rem Test one Command Processor
set z_testID=1
call bat\asmlg %z_TraceMode% rt\test\TESTCMD3 || goto error

rem name of test file
set TESTCMDFILE=%RTPATH%\bat\TESTCMD3.BAT

call bat\asmlg %z_TraceMode% %RTPATH%\TESTCMD3 || goto error

rem Test two Command Processors (3 tests)
rem A. Both have same number of lines of output
rem B Second CP has more lines of output
rem C. First CP has more lines of output

set z_testID=2A
call bat\asmlg %z_TraceMode% rt\test\TESTCMD4 PARM(1) || goto error

rem names of test files for first test
set TESTCMDFILE1=%RTPATH%\bat\TESTCMD4A.BAT
set TESTCMDFILE2=%RTPATH%\bat\TESTCMD4B.BAT

call bat\asmlg %z_TraceMode% %RTPATH%\TESTCMD4 || goto error
set z_testID=2B
call bat\asmlg %z_TraceMode% rt\test\TESTCMD4 PARM(2) || goto error

rem names of test files for second test
set TESTCMDFILE1=%RTPATH%\bat\TESTCMD4A.BAT
set TESTCMDFILE2=%RTPATH%\bat\TESTCMD4C.BAT

call bat\asmlg %z_TraceMode% %RTPATH%\TESTCMD4 || goto error
set z_testID=2C
call bat\asmlg %z_TraceMode% rt\test\TESTCMD4 PARM(3) || goto error

rem names of test files for third test
set TESTCMDFILE1=%RTPATH%\bat\TESTCMD4C.BAT
set TESTCMDFILE2=%RTPATH%\bat\TESTCMD4B.BAT

call bat\asmlg %z_TraceMode% %RTPATH%\TESTCMD4 || goto error
set z_ReturnCode=0
goto return

Expand Down
Loading

0 comments on commit fb5b5aa

Please sign in to comment.