~ubuntu-branches/ubuntu/oneiric/gwibber/oneiric

« back to all changes in this revision

Viewing changes to run-tests

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2009-02-20 14:45:57 UTC
  • Revision ID: james.westby@ubuntu.com-20090220144557-xmhe71jdn1mf7yo9
Tags: upstream-0.8
ImportĀ upstreamĀ versionĀ 0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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)