11 |
Just run this file as a python script to execute all tests |
Just run this file as a python script to execute all tests |
12 |
""" |
""" |
13 |
|
|
14 |
|
__version__ = "$Revision$" |
15 |
|
# $Source$ |
16 |
|
# $Id$ |
17 |
|
|
18 |
import os, sys |
import os, sys |
19 |
|
import warnings |
20 |
import unittest |
import unittest |
21 |
|
|
22 |
import support |
import support |
26 |
def main(): |
def main(): |
27 |
"""Run all the tests in the Thuban test suite""" |
"""Run all the tests in the Thuban test suite""" |
28 |
|
|
29 |
|
# Turn Thuban's deprecation warnings into errors so they're cought |
30 |
|
# by the tests |
31 |
|
# |
32 |
|
# Maintenance: Keep a warning filter until the backwards |
33 |
|
# compatibility code is removed at which time using the old |
34 |
|
# interfaces should lead to other errors anyway. |
35 |
|
|
36 |
|
# The layer attributes table, shapetable, shapefile and filename are |
37 |
|
# deprecated. |
38 |
|
warnings.filterwarnings("error", "The Layer attribute.*is deprecated", |
39 |
|
DeprecationWarning) |
40 |
|
|
41 |
|
# Usage of the old table interface. This old interface is still used |
42 |
|
# by the test_table.py module which calls filterwarnings too to |
43 |
|
# ignore the warnings issued by its own intended use of the old |
44 |
|
# interface. |
45 |
|
warnings.filterwarnings("error", ".*old table interface.*", |
46 |
|
DeprecationWarning) |
47 |
|
|
48 |
|
|
49 |
|
# All Python files starting with test in the current directory |
50 |
|
# contain test cases. |
51 |
|
# FIXME: It should be possible to run runtests.py even when not in |
52 |
|
# the test directory |
53 |
files = os.listdir(os.curdir) |
files = os.listdir(os.curdir) |
54 |
names = [] |
names = [] |
55 |
for file in files: |
for file in files: |
60 |
runner = unittest.TextTestRunner(verbosity = 2) |
runner = unittest.TextTestRunner(verbosity = 2) |
61 |
result = runner.run(suite) |
result = runner.run(suite) |
62 |
|
|
63 |
support.print_garbage_information() |
support.print_additional_summary() |
64 |
|
|
65 |
sys.exit(not result.wasSuccessful()) |
sys.exit(not result.wasSuccessful()) |
66 |
|
|