1 |
bh |
292 |
# Copyright (c) 2002 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 |
|
|
Thuban.Lib.connector._the_connector.print_connections() |
26 |
|
|
|
27 |
|
|
files = os.listdir(os.curdir) |
28 |
|
|
names = [] |
29 |
|
|
for file in files: |
30 |
|
|
if file[:4] == "test" and file[-3:] == ".py": |
31 |
|
|
names.append(file[:-3]) |
32 |
|
|
|
33 |
|
|
suite = unittest.defaultTestLoader.loadTestsFromNames(names) |
34 |
|
|
runner = unittest.TextTestRunner(verbosity = 2) |
35 |
|
|
result = runner.run(suite) |
36 |
|
|
|
37 |
|
|
Thuban.Lib.connector._the_connector.print_connections() |
38 |
|
|
|
39 |
|
|
sys.exit(not result.wasSuccessful()) |
40 |
|
|
|
41 |
|
|
|
42 |
|
|
if __name__ == "__main__": |
43 |
|
|
main() |