Skip to content

Commit

Permalink
Python parser: add a special test file that just tests parser regress…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
annevankesteren committed Mar 5, 2008
1 parent c72f270 commit 209da05
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions python/tests/runparsertests.py
@@ -0,0 +1,27 @@
import sys
import os
import glob
import unittest

#Allow us to import the parent module
os.chdir(os.path.split(os.path.abspath(__file__))[0])
sys.path.insert(0, os.path.abspath(os.curdir))
sys.path.insert(0, os.path.abspath(os.pardir))
sys.path.insert(0, os.path.join(os.path.abspath(os.pardir), "src"))

def buildTestSuite():
suite = unittest.TestSuite()
for testcase in glob.glob('test_*.py'):
if testcase in ("test_tokenizer.py", "test_parser.py", "test_parser2.py"):
module = os.path.splitext(testcase)[0]
suite.addTest(__import__(module).buildTestSuite())
return suite

def main():
results = unittest.TextTestRunner().run(buildTestSuite())
return results

if __name__ == "__main__":
results = main()
if not results.wasSuccessful():
sys.exit(1)

0 comments on commit 209da05

Please sign in to comment.