Tizen 2.0 Release
[external/mawk.git] / test / mawktest.bat
1 echo off
2 rem  This is a simple test that a new made mawk seems to
3 rem  be working OK.
4 rem  It's certainly not exhaustive, but the last two tests in 
5 rem  particular use most features.
6 rem 
7 rem  It needs to be run from mawk/test and mawk needs to be in PATH 
8 rem
9 rem  it's too bad that years after MSDOS was introduced that basic
10 rem  system utilities like fc still don't return valid exit codes!!!
11
12 set dat=mawktest.dat
13 if %CMP%.==. set CMP=cmp
14
15 rem  find out which mawk we're testing
16 ..\mawk -Wv
17
18 rem ################################
19
20 echo testing input and field splitting
21 ..\mawk -f wc.awk %dat% > temp$$
22 %CMP% temp$$ wc-awk.out
23 if errorlevel 1 goto :done
24
25 rem ####################################
26
27 echo testing regular expression matching
28 ..\mawk -f reg0.awk %dat% > temp$$
29 ..\mawk -f reg1.awk %dat% >> temp$$
30 ..\mawk -f reg2.awk %dat% >> temp$$
31 %CMP% temp$$ reg-awk.out
32 if errorlevel 1 goto :done
33
34 rem ######################################
35
36 echo testing arrays and flow of control
37 ..\mawk -f wfrq0.awk %dat% > temp$$
38 %CMP% temp$$ wfrq-awk.out
39 if errorlevel 1 goto :done
40
41 rem ################################
42
43 echo testing function calls and general stress test
44 ..\mawk -f ../examples/decl.awk %dat% > temp$$
45 %CMP% temp$$ decl-awk.out
46 if errorlevel 1 goto :done
47
48 echo if %CMP% always encountered "no differences", then the tested mawk seems OK
49 :done
50 del temp$$
51 set dat=