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