A2osX/TESTS/BADSHTEST

42 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX
AUTO 4,1
#!/BIN/SH
#
# BADSHTEST tests that the shell detects and properly handles
# (with error) an invalid shell script. It should return error
# F6/246. This script calls BADSCRIPT and checks for that code.
#
# We first need to check if this script is being called
# by BUILDTEST or if it is being run interactively.
#
IF [ -F ${ROOT}TMP/BUILDTEST ]
ELSE
SET B = 0
FI
#
echo "\n\nThis test will generate an error"
echo "between the lines. This is expected."
echo "---------------------------------------"
BADSCRIPT
SET R = $?
ECHO $R
echo "---------------------------------------"
IF [ $R -EQ 246 ]
IF [ $B -GT 0 ]
SET P = $P + 1
echo "I am at AAAAAAA Pass with Log"
echo "BADSHTEST Passed" >> ${Log}
FI
echo "\nBADSHTEST Passed\n"
ELSE
IF [ $B -GT 0 ]
SET F = $F + 1
echo "I am at BBBBBBB Fail with Log"
echo "BADSHTEST Failed - $R" >> ${Log}
FI
echo "\nBADSHTEST Failed - $R\n"
FI
MAN
TEXT /MAKE/USR/SHARE/TESTS/BADSHTEST