2 # ----------------------------------------------------------------------
5 # Run tests for the yacc module
6 # ----------------------------------------------------------------------
11 print "Usage: python testyacc.py directory"
17 for o
in sys
.argv
[1:]:
25 print "Usage: python testyacc.py [-make] directory"
28 f
= glob
.glob("%s/%s" % (dirname
,"yacc_*.py"))
30 print "**** Running tests for yacc ****"
34 print "Testing %-32s" % name
,
35 os
.system("rm -f %s/parsetab.*" % dirname
)
37 if not os
.path
.exists("%s.exp" % name
):
38 os
.system("python %s.py >%s.exp 2>&1" % (name
,name
))
41 os
.system("python %s.py >%s.out 2>&1" % (name
,name
))
42 a
= os
.system("diff %s.out %s.exp >%s.dif" % (name
,name
,name
))
51 print "Failed. See %s.dif" % name