Tizen 2.0 Release
[external/mawk.git] / test / mawktest.g
1 # mawk test gulam script
2 #
3 #  This is a simple test that a new made mawk seems to
4 #  be working OK.
5 #  Its certainly not exhaustive, but the last two tests in 
6 #  particular use most features.
7
8 #  It needs to be run from mawk/test and mawk needs to be in PATH 
9 #
10
11 ## set dat=mawk_test.dat
12
13 #  find out which mawk were testing
14 echo testing mawk version
15 .\mawk.ttp -W version
16 echo  ===================== status = $status  =====================
17 echo " "
18 # ################################
19
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  =====================
24 echo " "
25 # ####################################
26
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  =====================
33 echo " "
34 # ######################################
35
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  =====================
40 echo " "
41 # ################################
42
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  =====================
47 echo " "
48 echo if the status after each test is 0, then the tested mawk seems OK
49 #rm temp[1-4]