File: run-tests

package info (click to toggle)
gwibber 1.2.0+bzr358-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,228 kB
  • ctags: 894
  • sloc: python: 4,691; makefile: 43
file content (26 lines) | stat: -rwxr-xr-x 596 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python

"""

Gwibber Client Test Suite

"""

import sys, unittest, tests
from os.path import join, dirname, exists, realpath

def runTests(suite):
    testRunner = unittest.TextTestRunner()
    result = testRunner.run(suite)
    sys.exit(not result.wasSuccessful())

# run tests against the local ./gwibber module
source_tree_gwibber = join(dirname(__file__), "gwibber")
if exists(join(source_tree_gwibber, "client.py")):
    sys.path.insert(0, realpath(dirname(source_tree_gwibber)))
    try:
        runTests(tests.suite())
    finally:
        del sys.path[0]
else:
    exit(1)