1 |
# Copyright (c) 2002, 2003 by Intevation GmbH |
2 |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
4 |
# |
5 |
# This program is free software under the GPL (>=v2) |
6 |
# Read the file COPYING coming with Thuban for details. |
7 |
|
8 |
""" |
9 |
Main entry point for the Thuban test suite. |
10 |
|
11 |
Just run this file as a python script to execute all tests |
12 |
""" |
13 |
|
14 |
|
15 |
import os, sys |
16 |
import unittest |
17 |
|
18 |
import support |
19 |
support.initthuban() |
20 |
import Thuban.Lib.connector |
21 |
|
22 |
def main(): |
23 |
"""Run all the tests in the Thuban test suite""" |
24 |
|
25 |
files = os.listdir(os.curdir) |
26 |
names = [] |
27 |
for file in files: |
28 |
if file[:4] == "test" and file[-3:] == ".py": |
29 |
names.append(file[:-3]) |
30 |
|
31 |
suite = unittest.defaultTestLoader.loadTestsFromNames(names) |
32 |
runner = unittest.TextTestRunner(verbosity = 2) |
33 |
result = runner.run(suite) |
34 |
|
35 |
support.print_garbage_information() |
36 |
|
37 |
sys.exit(not result.wasSuccessful()) |
38 |
|
39 |
|
40 |
if __name__ == "__main__": |
41 |
main() |