1 |
# Copyright (c) 2002, 2003, 2004 by Intevation GmbH |
# Copyright (c) 2002, 2003, 2004, 2005, 2006 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
# |
# |
60 |
def main(): |
def main(): |
61 |
"""Run all the tests in the Thuban test suite""" |
"""Run all the tests in the Thuban test suite""" |
62 |
|
|
63 |
# Turn Thuban's deprecation warnings into errors so they're cought |
# Turn Thuban's deprecation warnings into errors so they're caught |
64 |
# by the tests |
# by the tests |
65 |
# |
# |
66 |
# Maintenance: Keep a warning filter until the backwards |
# Maintenance: Keep a warning filter until the backwards |
74 |
|
|
75 |
verbosity = 1 |
verbosity = 1 |
76 |
|
|
77 |
opts, args = getopt.getopt(sys.argv[1:], 'v', ['verbose']) |
opts, args = getopt.getopt(sys.argv[1:], 'v', |
78 |
|
['verbose', 'setdecimalcommalocale', "internal-encoding="]) |
79 |
for optchar, value in opts: |
for optchar, value in opts: |
80 |
if optchar in ("-v", "--verbose"): |
if optchar in ("-v", "--verbose"): |
81 |
verbosity = 2 |
verbosity = 2 |
82 |
|
elif optchar == "--internal-encoding": |
83 |
|
Thuban.set_internal_encoding(value) |
84 |
|
elif optchar == "--setdecimalcommalocale": |
85 |
|
import localessupport |
86 |
|
oldlocale = localessupport.setdecimalcommalocale() |
87 |
|
if oldlocale == None: |
88 |
|
print>>sys.stderr, "Did not find a locale with comma." |
89 |
else: |
else: |
90 |
print>>sys.stderr, "Unknown option", optchar |
print>>sys.stderr, "Unknown option", optchar |
91 |
|
|
102 |
names = find_test_modules(".") |
names = find_test_modules(".") |
103 |
names += find_test_modules("../Extensions/svgexport/test", |
names += find_test_modules("../Extensions/svgexport/test", |
104 |
"Extensions.svgexport.test") |
"Extensions.svgexport.test") |
105 |
|
names += find_test_modules("../Extensions/ogr/test", |
106 |
|
"Extensions.ogr.test") |
107 |
suite = unittest.defaultTestLoader.loadTestsFromNames(names) |
suite = unittest.defaultTestLoader.loadTestsFromNames(names) |
108 |
runner = support.ThubanTestRunner(verbosity = verbosity) |
runner = support.ThubanTestRunner(verbosity = verbosity) |
109 |
result = support.execute_as_testsuite(runner.run, suite) |
result = support.execute_as_testsuite(runner.run, suite) |