1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
# mawk test gulam script
#
# This is a simple test that a new made mawk seems to
# be working OK.
# Its certainly not exhaustive, but the last two tests in
# particular use most features.
#
# It needs to be run from mawk/test and mawk needs to be in PATH
#
## set dat=mawk_test.dat
# find out which mawk were testing
echo testing mawk version
.\mawk.ttp -W version
echo ===================== status = $status =====================
echo " "
# ################################
echo testing input and field splitting
.\mawk.ttp -f wc.awk mawk_tes.dat >temp1
diff -c temp1 wc-awk.out
echo ===================== status = $status =====================
echo " "
# ####################################
echo testing regular expression matching
.\mawk.ttp -f reg0.awk mawk_tes.dat >temp2
.\mawk.ttp -f reg1.awk mawk_tes.dat >>temp2
.\mawk.ttp -f reg2.awk mawk_tes.dat >>temp2
diff -c temp2 reg-awk.out
echo ===================== status = $status =====================
echo " "
# ######################################
echo testing arrays and flow of control
.\mawk.ttp -f wfrq0.awk mawk_tes.dat >temp3
diff -c temp3 wfrq-awk.out
echo ===================== status = $status =====================
echo " "
# ################################
echo testing function calls and general stress test
.\mawk.ttp -f examples\decl.awk mawk_tes.dat >temp4
diff -c temp4 decl-awk.out
echo ===================== status = $status =====================
echo " "
echo if the status after each test is 0, then the tested mawk seems OK
#rm temp[1-4]
|