File: test.py

package info (click to toggle)
simpleparse 2.1.0a1-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 2,776 kB
  • ctags: 4,332
  • sloc: python: 7,036; ansic: 6,395; makefile: 22
file content (42 lines) | stat: -rwxr-xr-x 1,086 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import unittest
import mx_test, test_objectgenerator, test_simpleparsegrammar
import test_common_chartypes, test_common_numbers
import sys
try:
	import test_common_iso_date
except ImportError:
	sys.stderr.write( """Unable to test ISO dates, no mxDateTime module\n""" )
	test_common_iso_date = None
import test_common_strings, test_printers, test_optimisation, test_common_comments
import test_xml

import string
from simpleparse.stt import TextTools
mxVersion = tuple(string.split( TextTools.__version__, '.'))
mxVersion = mxVersion[:3]

def getSuite():
	set = []
	for module in [
		mx_test,
		test_objectgenerator,
		test_simpleparsegrammar,
		test_common_chartypes,
		test_common_numbers,
		test_common_iso_date,
		test_common_strings,
		test_common_comments,
		test_printers,
		test_xml,
		test_optimisation,
	]:
		if hasattr( module, 'getSuite'):
			set.append( module.getSuite() )
		elif module:
			sys.stderr.write( "module %r has no getSuite function, skipping\n"%(module,))
	return unittest.TestSuite(
		set
	)

if __name__ == "__main__":
	unittest.main(defaultTest="getSuite")