187
by Dominic Evans
Add basic 'run-tests' and accompanying unittest code. |
1 |
#!/usr/bin/env python
|
2 |
||
3 |
"""
|
|
4 |
||
5 |
Gwibber Client Test Suite
|
|
6 |
||
7 |
"""
|
|
8 |
||
9 |
import sys, unittest, tests |
|
10 |
from os.path import join, dirname, exists, realpath |
|
11 |
||
12 |
def runTests(suite): |
|
13 |
testRunner = unittest.TextTestRunner() |
|
14 |
result = testRunner.run(suite) |
|
15 |
sys.exit(not result.wasSuccessful()) |
|
16 |
||
17 |
# run tests against the local ./gwibber module
|
|
18 |
source_tree_gwibber = join(dirname(__file__), "gwibber") |
|
19 |
if exists(join(source_tree_gwibber, "client.py")): |
|
20 |
sys.path.insert(0, realpath(dirname(source_tree_gwibber))) |
|
21 |
try: |
|
22 |
runTests(tests.suite()) |
|
23 |
finally: |
|
24 |
del sys.path[0] |
|
25 |
else: |
|
26 |
exit(1) |