#! /usr/bin/env python # (Force the script to use the latest build.) # # test_parser.py import parser, traceback _numFailed = 0 def testChunk(t, fileName): global _numFailed print '----', fileName, try: st = parser.suite(t) tup = parser.st2tuple(st) # this discards the first ST; a huge memory savings when running # against a large source file like Tkinter.py. st = None new = parser.tuple2st(tup) except parser.ParserError, err: print print 'parser module raised exception on input file', fileName + ':' traceback.print_exc() _numFailed = _numFailed + 1 else: if tup != parser.st2tuple(new): print print 'parser module failed on input file', fileName _numFailed = _numFailed + 1 else: print 'o.k.' def testFile(fileName): t = open(fileName).read() testChunk(t, fileName) def test(): import sys args = sys.argv[1:] if not args: import glob args = glob.glob("*.py") args.sort() map(testFile, args) sys.exit(_numFailed != 0) if __name__ == '__main__': test()
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.docstring.pyo.40009 | File | 175 B | 0644 |
|
.example.pyo.40009 | File | 7.04 KB | 0644 |
|
.simple.pyo.40009 | File | 279 B | 0644 |
|
.source.pyo.40009 | File | 1.55 KB | 0644 |
|
.test_parser.pyo.40009 | File | 1.41 KB | 0644 |
|
.test_unparse.pyo.40009 | File | 8.45 KB | 0644 |
|
FILES | File | 91 B | 0644 |
|
README | File | 1.01 KB | 0644 |
|
docstring.py | File | 27 B | 0644 |
|
docstring.pyc | File | 175 B | 0644 |
|
docstring.pyo | File | 175 B | 0644 |
|
example.py | File | 5.59 KB | 0644 |
|
example.pyc | File | 7.04 KB | 0644 |
|
example.pyo | File | 7.04 KB | 0644 |
|
simple.py | File | 29 B | 0644 |
|
simple.pyc | File | 279 B | 0644 |
|
simple.pyo | File | 279 B | 0644 |
|
source.py | File | 741 B | 0644 |
|
source.pyc | File | 1.55 KB | 0644 |
|
source.pyo | File | 1.55 KB | 0644 |
|
test_parser.py | File | 1.16 KB | 0755 |
|
test_parser.pyc | File | 1.41 KB | 0644 |
|
test_parser.pyo | File | 1.41 KB | 0644 |
|
test_unparse.py | File | 5.44 KB | 0644 |
|
test_unparse.pyc | File | 8.45 KB | 0644 |
|
test_unparse.pyo | File | 8.45 KB | 0644 |
|
unparse.py | File | 16.85 KB | 0644 |
|
unparse.pyc | File | 23.44 KB | 0644 |
|
unparse.pyo | File | 23.36 KB | 0644 |
|