2 rem This is a simple test that a new made mawk seems to
4 rem It's certainly not exhaustive, but the last two tests in
5 rem particular use most features.
7 rem It needs to be run from mawk/test and mawk needs to be in PATH
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!!!
13 if %CMP%.==. set CMP=cmp
15 rem find out which mawk we're testing
18 rem ################################
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
25 rem ####################################
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
34 rem ######################################
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
41 rem ################################
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
48 echo if %CMP% always encountered "no differences", then the tested mawk seems OK