mirror of
https://github.com/A2osX/A2osX.git
synced 2024-10-31 23:09:33 +00:00
Updated tests and XLS issues list.
This commit is contained in:
parent
4ce1afaf6b
commit
aab92e3631
Binary file not shown.
Binary file not shown.
@ -18,19 +18,22 @@ AUTO 4,1
|
||||
#
|
||||
# $0 should be name of script
|
||||
#
|
||||
IF [ -Z $T ]
|
||||
SET T = 0
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ $0 = "ARGTEST2" ]
|
||||
IF [ $0 = "${PWD}ARGTEST2" ]
|
||||
IF [ -N $Log ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 0 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 0 Passed\n"
|
||||
echo "ARGTEST Arg 0 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 0 Failed - $0" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 0 Failed\n"
|
||||
echo "ARGTEST Arg 0 Failed - $0"
|
||||
FI
|
||||
#
|
||||
# $1 should be 'A'
|
||||
@ -41,13 +44,13 @@ IF [ $1 = "A" ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 1 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 1 Passed\n"
|
||||
echo "ARGTEST Arg 1 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 1 Failed - $1" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 1 Failed\n"
|
||||
echo "ARGTEST Arg 1 Failed"
|
||||
FI
|
||||
#
|
||||
# $2 should be '1'
|
||||
@ -58,13 +61,13 @@ IF [ $2 -EQ 1 ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 2 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 2 Passed\n"
|
||||
echo "ARGTEST Arg 2 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 2 Failed - $2" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 2 Failed\n"
|
||||
echo "ARGTEST Arg 2 Failed"
|
||||
FI
|
||||
#
|
||||
# $3 should be 'B'
|
||||
@ -75,13 +78,13 @@ IF [ $3 = "B" ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 3 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 3 Passed\n"
|
||||
echo "ARGTEST Arg 3 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 3 Failed - $3" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 3 Failed\n"
|
||||
echo "ARGTEST Arg 3 Failed"
|
||||
FI
|
||||
#
|
||||
# $4 should be '2'
|
||||
@ -92,13 +95,13 @@ IF [ $4 -EQ 2 ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 4 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 4 Passed\n"
|
||||
echo "ARGTEST Arg 4 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 4 Failed - $4" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 4 Failed\n"
|
||||
echo "ARGTEST Arg 4 Failed"
|
||||
FI
|
||||
#
|
||||
# $5 should be 'C'
|
||||
@ -109,13 +112,13 @@ IF [ $5 = "C" ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 5 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 5 Passed\n"
|
||||
echo "ARGTEST Arg 5 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 5 Failed - $5" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 5 Failed\n"
|
||||
echo "ARGTEST Arg 5 Failed"
|
||||
FI
|
||||
#
|
||||
# $6 should be '3'
|
||||
@ -126,13 +129,13 @@ IF [ $6 -EQ 3 ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 6 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 6 Passed\n"
|
||||
echo "ARGTEST Arg 6 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 6 Failed - $6" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 6 Failed\n"
|
||||
echo "ARGTEST Arg 6 Failed"
|
||||
FI
|
||||
#
|
||||
# $7 should be 'Hello'
|
||||
@ -143,13 +146,13 @@ IF [ $7 = "Hello" ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 7 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 7 Passed\n"
|
||||
echo "ARGTEST Arg 7 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 7 Failed - $7" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 7 Failed\n"
|
||||
echo "ARGTEST Arg 7 Failed"
|
||||
FI
|
||||
#
|
||||
# $8 should be the process id of the parent
|
||||
@ -160,30 +163,30 @@ IF [ $8 -EQ $@ ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 8 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 8 Passed\n"
|
||||
echo "ARGTEST Arg 8 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 8 Failed - $8 vs $@" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 8 Failed\n"
|
||||
echo "ARGTEST Arg 8 Failed"
|
||||
FI
|
||||
#
|
||||
# $9 should be '82'
|
||||
#
|
||||
SET T = $T + 1
|
||||
IF [ $2 -EQ 82 ]
|
||||
IF [ $9 -EQ 82 ]
|
||||
IF [ -N $Log ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg 9 Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 9 Passed\n"
|
||||
echo "ARGTEST Arg 9 Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg 9 Failed - $9" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg 9 Failed\n"
|
||||
echo "ARGTEST Arg 9 Failed"
|
||||
FI
|
||||
#
|
||||
# $# should be '10'
|
||||
@ -194,32 +197,34 @@ IF [ $# -EQ 10 ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg Count Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg Count Passed\n"
|
||||
echo "ARGTEST Arg Count Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg Count Failed - $#" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg Count Failed\n"
|
||||
echo "ARGTEST Arg Count Failed"
|
||||
FI
|
||||
#
|
||||
# $* should be 'A 1 B 2 C 3 Hello $$ 82 Tenth'
|
||||
# $* should be 'A 1 B 2 C 3 Hello $@ 82 Tenth'
|
||||
# Note $$ was actually passed after Hello, but
|
||||
# we sub $@ as its our parents ID.
|
||||
#
|
||||
SET T = $T + 1
|
||||
IF [ $* = "A 1 B 2 C 3 Hello $$ 82 Tenth" ]
|
||||
IF [ $* = "A 1 B 2 C 3 Hello $@ 82 Tenth" ]
|
||||
IF [ -N $Log ]
|
||||
SET P = $P + 1
|
||||
echo "ARGTEST Arg ALL Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg ALL Passed\n"
|
||||
echo "ARGTEST Arg ALL Passed"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "ARGTEST Arg ALL Failed - $*" >> ${Log}
|
||||
FI
|
||||
echo "\nARGTEST Arg ALL Failed\n"
|
||||
echo "ARGTEST Arg ALL Failed"
|
||||
FI
|
||||
ECHO "\nArg Tests Done
|
||||
ECHO "Arg Tests Done"
|
||||
IF [ -N $Log ]
|
||||
echo "Arg Tests Complete" >> ${Log}
|
||||
FI
|
||||
|
@ -7,27 +7,26 @@ AUTO 4,1
|
||||
# (with error) an invalid shell script. It should return error
|
||||
# F6/246. This script calls BADSCRIPT and checks for that code.
|
||||
#
|
||||
echo "\n\nThis test will generate an error"
|
||||
echo "between the lines. This is expected."
|
||||
echo "---------------------------------------"
|
||||
BADSCRIPT
|
||||
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
|
||||
BADSCRIPT 2> /DEV/NULL
|
||||
SET R = $?
|
||||
ECHO $R
|
||||
echo "---------------------------------------"
|
||||
IF [ $R -EQ 246 ]
|
||||
IF [ -N $Log ]
|
||||
SET P = $P + 1
|
||||
echo "I am at AAAAAAA Pass with Log"
|
||||
echo "BADSHTEST Passed" >> ${Log}
|
||||
FI
|
||||
echo "\nBADSHTEST Passed\n"
|
||||
ELSE
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "I am at BBBBBBB Fail with Log"
|
||||
echo "BADSHTEST Failed - $R" >> ${Log}
|
||||
FI
|
||||
echo "\nBADSHTEST Failed - $R\n"
|
||||
FI
|
||||
SET R =
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/BADSHTEST
|
||||
|
@ -45,24 +45,35 @@ ECHO -N " Date: " >> ${Log}
|
||||
DATE >> ${Log}
|
||||
ECHO -N " Time: " >> ${Log}
|
||||
TIME >> ${Log}
|
||||
ECHO "----------------------------------------\n\n" >> ${Log}
|
||||
ECHO "----------------------------------------\n" >> ${Log}
|
||||
#
|
||||
# Capture Mem to Log
|
||||
#
|
||||
MEM >> ${Log}
|
||||
ECHO "----------------------------------------\n\n" >> ${Log}
|
||||
ECHO "\n----------------------------------------\n" >> ${Log}
|
||||
#
|
||||
# First Create and Set the Test Counters
|
||||
#
|
||||
SET T = 1
|
||||
SET P = 0
|
||||
SET F = 0
|
||||
|
||||
#
|
||||
# Run The Tests using the current shell (. test)
|
||||
#
|
||||
. BADSHTEST
|
||||
ECHO "\n----------------------------------------\n" >> ${Log}
|
||||
. ECHOTEST
|
||||
ECHO "\n----------------------------------------\n" >> ${Log}
|
||||
. ARGTEST
|
||||
ECHO "\n----------------------------------------\n" >> ${Log}
|
||||
. IFLEVEL
|
||||
ECHO "\n----------------------------------------\n" >> ${Log}
|
||||
. MD5TEST
|
||||
ECHO "\n----------------------------------------\n" >> ${Log}
|
||||
. IFZNTEST
|
||||
ECHO "\n----------------------------------------\n" >> ${Log}
|
||||
. CATTEST
|
||||
#
|
||||
# End of Tests
|
||||
#
|
||||
@ -72,10 +83,15 @@ echo " Tests Passed: ${P}"
|
||||
echo " Tests Failed: ${F}"
|
||||
echo "----------------------------------------\n"
|
||||
#echo
|
||||
echo "----------------------------------------" >> ${Log}
|
||||
echo "\n----------------------------------------" >> ${Log}
|
||||
echo " Total Tests: ${T}" >> ${Log}
|
||||
echo " Tests Passed: ${P}" >> ${Log}
|
||||
echo " Tests Failed: ${F}" >> ${Log}
|
||||
echo "----------------------------------------" >> ${Log}
|
||||
SET T =
|
||||
SET P =
|
||||
SET F =
|
||||
SET B =
|
||||
SET Log =
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/BUILDTEST
|
||||
|
@ -8,21 +8,29 @@ ECHO "\f\n\n Cat Test"
|
||||
echo "\nThis script will perform tests of the CAT command"
|
||||
echo "\nThe first cats a file with line numbers at the left.\n"
|
||||
READ -P "Press Return to start test" Z
|
||||
IF [ -N $Log ]
|
||||
ECHO "Begin CAT Tests" >> ${Log}
|
||||
ELSE
|
||||
SET T = 0
|
||||
SET F = 0
|
||||
SET P = 0
|
||||
FI
|
||||
SET T = $T + 1
|
||||
echo \n
|
||||
echo "\n"
|
||||
CAT -N CATTEXT
|
||||
echo \n
|
||||
echo "\n"
|
||||
read -P "Did you see 8 numbered lines: " Z
|
||||
ECHO
|
||||
IF [ $Z = "y" ]
|
||||
SET Z = "Y"
|
||||
FI
|
||||
IF [ $Z = "Y" ]
|
||||
IF [ $B -GT 0 ]
|
||||
IF [ -N $Log ]
|
||||
SET P = $P + 1
|
||||
echo "CAT -N Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
IF [ $B -GT 0 ]
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "CAT -N Failed" >> ${Log}
|
||||
FI
|
||||
@ -30,47 +38,59 @@ FI
|
||||
ECHO "\nThis next test CATs the same file but removes"
|
||||
ECHO "the duplicate empty lines\n"
|
||||
READ -P "Press Return to start test" Z
|
||||
echo \n
|
||||
echo "\n"
|
||||
SET T = $T + 1
|
||||
CAT -S CATTEXT
|
||||
echo \n
|
||||
read -P "Did you just 4 lines: " Z
|
||||
CAT -N -S CATTEXT
|
||||
echo "\n"
|
||||
read -P "Did you see just 5 lines: " Z
|
||||
ECHO
|
||||
IF [ $Z = "y" ]
|
||||
SET Z = "Y"
|
||||
FI
|
||||
IF [ $Z = "Y" ]
|
||||
IF [ $B -GT 0 ]
|
||||
IF [ -N $Log ]
|
||||
SET P = $P + 1
|
||||
echo "CAT -S Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
IF [ $B -GT 0 ]
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "CAT -S Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
ECHO "\nThis next test CATs a binary file which should"
|
||||
ECHO "be display as code in brackets []\n"
|
||||
ECHO "\nThis next test CATs a special file and displays"
|
||||
ECHO "its contents in code.\n"
|
||||
READ -P "Press Return to start test" Z
|
||||
echo \n
|
||||
echo "\n"
|
||||
SET T = $T + 1
|
||||
CAT -A CATCHARS
|
||||
echo \n
|
||||
read -P "Was the CAT display correct: " Z
|
||||
ECHO "\n\n"
|
||||
ECHO "The following should have been displayed above:"
|
||||
ECHO "[ENQ][ACK][BEL][BS][TAB][VT][FF][SI][DLE][DC1][DC2][DC3]"
|
||||
ECHO "[DC4][NAK][SYN][ETB][CAN][EM][SUB][ESC][FS][GS][RS][US]"
|
||||
ECHO
|
||||
read -P "Is that what was displayed: " Z
|
||||
ECHO
|
||||
IF [ $Z = "y" ]
|
||||
SET Z = "Y"
|
||||
FI
|
||||
IF [ $Z = "Y" ]
|
||||
IF [ $B -GT 0 ]
|
||||
IF [ -N $Log ]
|
||||
SET P = $P + 1
|
||||
echo "CAT -A Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
IF [ $B -GT 0 ]
|
||||
IF [ -N $Log ]
|
||||
SET F = $F + 1
|
||||
echo "CAT -A Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
Echo "\nEnd of Cat Test"
|
||||
IF [ -N $Log ]
|
||||
echo "End of Cat Test" >> ${Log}
|
||||
FI
|
||||
SET C1 =
|
||||
SET D1 =
|
||||
SET Z =
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/CATTEST
|
||||
|
@ -22,7 +22,7 @@ FI
|
||||
IF [ $Z != "Y" ]
|
||||
ECHO "\nFAILED Coretest READ"
|
||||
ECHO "\nTerminating CORETEST Early\n"
|
||||
EXIT 254
|
||||
EXIT 99
|
||||
FI
|
||||
ECHO "\nNext we test for Return Codes."
|
||||
ECHO "Note: You may see an error on the screen from running"
|
||||
@ -36,7 +36,7 @@ IF [ $? -EQ 144 ]
|
||||
ELSE
|
||||
ECHO "\nFAILED Coretest RC"
|
||||
ECHO "\nTerminating CORETEST Early\n"
|
||||
EXIT 254
|
||||
EXIT 99
|
||||
FI
|
||||
ECHO "\nNext we test the IF script element."
|
||||
ECHO "Note this does not test all IF options,"
|
||||
@ -46,12 +46,12 @@ PAUSE
|
||||
IF [ -D ${ROOT} ]
|
||||
ELSE
|
||||
ECHO "\nFailed Coretest IF -D"
|
||||
EXIT 254
|
||||
EXIT 99
|
||||
FI
|
||||
IF [ -D ${ROOT}A2OSX.SYSTEM ]
|
||||
IF [ -F ${ROOT}A2OSX.SYSTEM ]
|
||||
ELSE
|
||||
ECHO "\nFailed Coretest IF -F"
|
||||
EXIT 254
|
||||
EXIT 99
|
||||
FI
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/CORETEST
|
||||
|
@ -161,6 +161,7 @@ ELSE
|
||||
echo "ECHO Newline Suppress Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
echo
|
||||
echo "\nEcho Tests Done"
|
||||
IF [ -N $Log ]
|
||||
echo "ECHO Tests Complete" >> ${Log}
|
||||
|
@ -1,23 +0,0 @@
|
||||
NEW
|
||||
PREFIX
|
||||
AUTO 4,1
|
||||
#!/BIN/SH
|
||||
read -P "String size: " Z
|
||||
IF [ $Z = "20" ]
|
||||
SET A = "A"
|
||||
ELSE
|
||||
IF [ $Z = "40" ]
|
||||
SET A = "AA"
|
||||
ELSE
|
||||
IF [ $Z = "60" ]
|
||||
SET A = "AAA"
|
||||
ELSE
|
||||
ECHO "\n\nYou did not enter a valid size"
|
||||
EXIT
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
ECHO
|
||||
ECHO "I reached Here"
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/ENVTEST2
|
31
TESTS/FORTEST.txt
Normal file
31
TESTS/FORTEST.txt
Normal file
@ -0,0 +1,31 @@
|
||||
NEW
|
||||
PREFIX
|
||||
AUTO 4,1
|
||||
#!/BIN/SH
|
||||
#
|
||||
# This script tests the new FOR NEXT loop construct.
|
||||
#
|
||||
echo "\f\n\n FOR NEXT Tests"
|
||||
echo "\n\nThis script tests the FOR var IN 'LIST' construct."
|
||||
echo ""
|
||||
echo ""
|
||||
echo
|
||||
IF [ -N $Log ]
|
||||
ECHO "Begin FOR NEXT Tests" >> ${Log}
|
||||
ELSE
|
||||
SET T = 0
|
||||
SET F = 0
|
||||
SET P = 0
|
||||
FI
|
||||
SET LIST = "Remy Patrick Adam Admin Zeus Zero"
|
||||
SET COUNT = 0
|
||||
FOR ITEM IN $LIST
|
||||
ECHO $ITEM
|
||||
SET COUNT = $COUNT + 1
|
||||
NEXT
|
||||
ECHO "I counted $COUNT items"
|
||||
|
||||
|
||||
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/FORTEST
|
@ -5,14 +5,38 @@ AUTO 4,1
|
||||
#
|
||||
#
|
||||
#
|
||||
echo \f IFFILETEST Script
|
||||
echo \n\n
|
||||
echo Testing for this File
|
||||
IF [ -F /PKA2OSX/TESTS/IFFILETEST ]
|
||||
Echo Found by full path
|
||||
echo "\f\n\n IF File Tests"
|
||||
echo "\n\nThis script tests that the IF -F (FILE) -D"
|
||||
echo "(DIRECTORY) and -E (either FILE or DIRECTORY)"
|
||||
echo "options perform as expected."
|
||||
echo
|
||||
IF [ -N $Log ]
|
||||
ECHO "Begin IF File Tests" >> ${Log}
|
||||
ELSE
|
||||
Echo Not Found
|
||||
SET T = 0
|
||||
SET F = 0
|
||||
SET P = 0
|
||||
FI
|
||||
# First test for $0 thats full path of this file so
|
||||
# this should always work
|
||||
SET T = $T + 1
|
||||
IF [ -F $0 ]
|
||||
Echo "IF -F $0 True: Pased"
|
||||
ELSE
|
||||
Echo "IF -F $0 False: Pased"
|
||||
FI
|
||||
# Next Test for BUILDTEST with -F which should be in current dir
|
||||
|
||||
# Next Test for BUILDTEST with -E which should be in current dir
|
||||
|
||||
# Next Test for BUILDTEST with -D which should fail as its a file
|
||||
|
||||
# Next check for TESTDIR with -D a directory created for this test
|
||||
|
||||
# Next check for TESTDIR with -E a directory created for this test
|
||||
|
||||
# Next check for TESTDIR with -F which should fail as its a dir
|
||||
|
||||
echo Testing for IFFILETEST
|
||||
IF [ -F IFFILETEST ]
|
||||
Echo Found
|
||||
|
@ -3,31 +3,51 @@ NEW
|
||||
AUTO 4,1
|
||||
#!/BIN/SH
|
||||
#
|
||||
# If Level test
|
||||
# If Level test script
|
||||
#
|
||||
READ -P "Enter a number 1 through 7: " ANum
|
||||
IF [ $ANum = "1" ]
|
||||
ECHO "1 Typed"
|
||||
ECHO "\f\n\n Nested IF Level Test"
|
||||
SET GOODS = 0
|
||||
SET BADS = 0
|
||||
SET TESTS = 15
|
||||
WHILE [ $TESTS -ne 0 ]
|
||||
ECHO -N "\e[10;10HTesting Level: ${TESTS} "
|
||||
IF [ $TESTS = "1" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $ANum = "2" ]
|
||||
ECHO "2 Typed"
|
||||
IF [ $TESTS = "2" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $ANum = "3" ]
|
||||
ECHO "3 Typed"
|
||||
IF [ $TESTS = "3" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $ANum = "4" ]
|
||||
ECHO "4 Typed"
|
||||
IF [ $TESTS = "4" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $ANum = "5" ]
|
||||
ECHO "5 Typed"
|
||||
IF [ $TESTS = "5" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $ANum = "6" ]
|
||||
ECHO "6 Typed"
|
||||
IF [ $TESTS = "6" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $ANum = "7" ]
|
||||
ECHO "7 Typed"
|
||||
IF [ $TESTS = "7" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
ECHO "Bad Choice Typed"
|
||||
IF [ $TESTS = "8" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $TESTS = "9" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $TESTS = "10" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $TESTS = "11" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
IF [ $TESTS = "12" ]
|
||||
SET GOODS = $GOODS + 1
|
||||
ELSE
|
||||
SET BADS = $BADS + 1
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
@ -35,5 +55,56 @@ ELSE
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
SET TESTS = $TESTS - 1
|
||||
LOOP
|
||||
ECHO
|
||||
ECHO
|
||||
ECHO " Goods: ${GOODS} Bads: ${BADS}"
|
||||
IF [ $GOODS -eq 12 ]
|
||||
IF [ $BADS -eq 3 ]
|
||||
ECHO "\n\n Nested IF Level Test Passed"
|
||||
IF [ -N $Log ]
|
||||
SET T = $T + 1
|
||||
SET P = $P + 1
|
||||
ECHO "Nested IF Level Test Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "\n\n Nested IF Level Test Failed"
|
||||
ECHO " Expected 3 Bads, result was ${BADS}"
|
||||
IF [ -N $Log ]
|
||||
SET T = $T + 1
|
||||
SET F = $F + 1
|
||||
ECHO "Nested IF Level Test Failed" >> ${Log}
|
||||
ECHO "Expected 3 Bads, result was ${BADS}" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
ELSE
|
||||
IF [ $BADS -eq 3 ]
|
||||
ECHO "\n\n Nested IF Level Test Failed"
|
||||
ECHO " Expected 12 Goods, result was ${GOODS}"
|
||||
IF [ -N $Log ]
|
||||
SET T = $T + 1
|
||||
SET F = $F + 1
|
||||
ECHO "Nested IF Level Test Failed" >> ${Log}
|
||||
ECHO "Expected 12 Goods, result was ${GOODS}" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "\n\n Nested IF Level Test Failed"
|
||||
ECHO " Expected 12 Goods, result was ${GOODS}"
|
||||
ECHO " Expected 3 Bads, result was ${BADS}"
|
||||
IF [ -N $Log ]
|
||||
SET T = $T + 1
|
||||
SET F = $F + 1
|
||||
ECHO "Nested IF Level Test Failed" >> ${Log}
|
||||
ECHO "Expected 12 Goods, result was ${GOODS}" >> ${Log}
|
||||
ECHO "Expected 3 Bads, result was ${BADS}" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
FI
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/IFLEVEL
|
||||
|
@ -5,27 +5,165 @@ AUTO 4,1
|
||||
#
|
||||
# Testing the new IF -Z -N Options
|
||||
#
|
||||
echo "\f\n\n IF Null Tests"
|
||||
echo "\n\nThis script tests that the IF -Z (NULL) and -N"
|
||||
echo "(non-NULL) options perform as expected for both "
|
||||
echo "string, numeric, null and non-existent variables."
|
||||
echo
|
||||
IF [ -N $Log ]
|
||||
ECHO "Begin IF Null Tests" >> ${Log}
|
||||
ELSE
|
||||
SET T = 0
|
||||
SET F = 0
|
||||
SET P = 0
|
||||
FI
|
||||
SET ABC = "HELLO"
|
||||
SET DEF = ""
|
||||
SET T = $T + 1
|
||||
IF [ -Z $ABC ]
|
||||
ECHO "Z ABC True"
|
||||
ELSE
|
||||
ECHO "Z ABC False"
|
||||
ECHO "-Z for ABC True: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for ABC True: Failed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-Z for ABC False: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for ABC False: Passed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -N $ABC ]
|
||||
ECHO "N ABC True"
|
||||
ELSE
|
||||
ECHO "N ABC False"
|
||||
ECHO "-N for ABC True: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for ABC True: Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-N for ABC False: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for ABC False: Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -Z $DEF ]
|
||||
ECHO "Z DEF True"
|
||||
ELSE
|
||||
ECHO "Z DEF False"
|
||||
ECHO "-Z for NULL True: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for NULL True: Passed" >> ${Log}
|
||||
FI
|
||||
IF [ -N $DEF ]
|
||||
ECHO "N DEF True"
|
||||
ELSE
|
||||
ECHO "N DEF False"
|
||||
ECHO "-Z for NULL False: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for NULL False: Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -N $DEF ]
|
||||
ECHO "-N for NULL True: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for NULL True: Failed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-N for NULL False: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for NULL False: Passed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET ABC = 123
|
||||
SET DEF = 0
|
||||
SET T = $T + 1
|
||||
IF [ -Z $ABC ]
|
||||
ECHO "-Z for 123 True: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for 123 True: Failed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-Z for 123 False: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for 123 False: Passed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -N $ABC ]
|
||||
ECHO "-N for 123 True: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for 123 True: Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-N for 123 False: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for 123 False: Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -Z $DEF ]
|
||||
ECHO "-Z for 0 True: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for 0 True: Failed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-Z for 0 False: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for 0 False: Passed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -N $DEF ]
|
||||
ECHO "-N for 0 True: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for 0 True: Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-N for 0 False: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for 0 False: Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -Z $XYZ123 ]
|
||||
ECHO "-Z for non-existent var True: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for non-existent var True: Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-Z for non-existent var False: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-Z for non-existent var False: Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
SET T = $T + 1
|
||||
IF [ -N $XYZ123 ]
|
||||
ECHO "-N for non-existent var True: Failed"
|
||||
SET F = $F + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for non-existent var True: Failed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "-N for non-existent var False: Passed"
|
||||
SET P = $P + 1
|
||||
IF [ -N $Log ]
|
||||
ECHO "-N for non-existent var False: Passed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
ECHO
|
||||
IF [ -N $Log ]
|
||||
ECHO "End IF Null Tests" >> ${Log}
|
||||
FI
|
||||
MAN
|
||||
TEXT /MAKE/USR/SHARE/TESTS/IFZNTEST
|
||||
|
@ -19,9 +19,19 @@ ECHO "MD5 values.\n\n"
|
||||
SET Result = `MD5 -D "$TestPhrase"`
|
||||
IF [ $Result = $CorrectValue ]
|
||||
ECHO "This Test Passed"
|
||||
IF [ -N $Log ]
|
||||
SET T = $T + 1
|
||||
SET P = $P + 1
|
||||
ECHO "MD5 Test Passed" >> ${Log}
|
||||
FI
|
||||
ELSE
|
||||
ECHO "This Test Failed"
|
||||
ECHO "The returned result was: $Result"
|
||||
IF [ -N $Log ]
|
||||
SET T = $T + 1
|
||||
SET F = $F + 1
|
||||
ECHO "MD5 Test Failed" >> ${Log}
|
||||
FI
|
||||
FI
|
||||
echo \n\n
|
||||
MAN
|
||||
|
@ -4,7 +4,7 @@ AUTO 4,1
|
||||
#!/BIN/SH
|
||||
#
|
||||
# This script makes the support files needed for various
|
||||
# tests such as CATTEST.
|
||||
# test scripts such as CATTEST.
|
||||
#
|
||||
# This Creates the CATTEXT file used by CATTEST
|
||||
#
|
||||
@ -19,9 +19,19 @@ ECHO "This is Line 8" >> CATTEXT
|
||||
#
|
||||
# This Creates the CATCHARS file used by CATTEST
|
||||
#
|
||||
ECHO "\x00\x01\x02\x03\x04" > CATCHARS
|
||||
ECHO "\x05\x06\x07\x08\x09" >> CATCHARS
|
||||
ECHO "\x0A\x0B\x0C\x0D\x00" >> CATCHARS
|
||||
ECHO "\x05\x06\x07\x08\x09\x0B\x0C\x0F\x10\x11\x12\x13" > CATCHARS
|
||||
ECHO "\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F" >> CATCHARS
|
||||
#
|
||||
# A directory called TESTDIR is used by several tests
|
||||
#
|
||||
IF [ -D TESTDIR ]
|
||||
#dir already exists
|
||||
ELSE
|
||||
MD TESTDIR
|
||||
FI
|
||||
#
|
||||
#
|
||||
#
|
||||
MAN
|
||||
|
||||
TEXT /MAKE/USR/SHARE/TESTS/TESTSETUP
|
||||
|
Loading…
Reference in New Issue
Block a user