A2osX/TESTS/BADSHTEST.txt

35 lines
826 B
Plaintext
Raw Permalink Normal View History

2019-01-16 04:50:18 +00:00
NEW
PREFIX
2019-01-16 04:50:18 +00:00
AUTO 4,1
#!/BIN/SH
2019-01-16 04:50:18 +00:00
#
# 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.
#
2019-03-07 02:13:28 +00:00
echo "\f\n\n Bad Shell Script Test"
echo "\n\nThis script tests that the A2osX Shell (SH)"
echo "correctly tests that scripts contain the correct"
echo "shell script header #!:/bin/sh"
echo
2019-12-02 19:07:59 +00:00
SET -E
2019-11-29 20:29:25 +00:00
BADSCRIPT 2> /dev/null
2019-01-16 04:50:18 +00:00
SET R = $?
IF [ $R -EQ 118 ]
2019-03-01 18:19:14 +00:00
IF [ -N $Log ]
2019-01-16 04:50:18 +00:00
SET P = $P + 1
echo "BADSHTEST Passed" >> ${Log}
FI
echo "\nBADSHTEST Passed\n"
ELSE
2019-03-01 18:19:14 +00:00
IF [ -N $Log ]
2019-01-16 04:50:18 +00:00
SET F = $F + 1
echo "BADSHTEST Failed - $R" >> ${Log}
2019-01-16 04:50:18 +00:00
FI
2019-03-07 02:13:28 +00:00
echo "\nBADSHTEST Failed - $R\n"
2019-01-16 04:50:18 +00:00
FI
2019-03-07 02:13:28 +00:00
SET R =
SET -E
2019-01-16 04:50:18 +00:00
MAN
TEXT /MAKE/USR/SHARE/TESTS/BADSHTEST