Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/run-tests.py
blob: 793db3ae7a3acc5c46ba3a148ef0f89b7080ac91 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/python
# This is a dumb script to run tests on the sugar-jhbuild installed files
# The path added is the default path for the jhbuild build

INSTALL_PATH="../../../../../../install/lib/python2.5/site-packages/"

import os, sys
sys.path.insert(0,
    os.path.abspath(INSTALL_PATH)
)

FULL_PATH = os.path.join(INSTALL_PATH,"sugar/tutorius")
SUBDIRS = ["uam"]
GLOB_PATH = os.path.join(FULL_PATH,"*.py")
import unittest
from glob import glob
def report_files():
    ret = glob(GLOB_PATH)
    for dir in SUBDIRS:
        ret += glob(os.path.join(FULL_PATH,dir,"*.py"))
    return ret

import sys
if __name__=='__main__':
    if "--coverage" in sys.argv:
        sys.argv=[arg for arg in sys.argv if arg != "--coverage"]
        import coverage
        coverage.erase()
        #coverage.exclude('raise NotImplementedError')
        coverage.start()

        import coretests
        import servicestests
        import gtkutilstests
        #import overlaytests # broken
        import linear_creatortests
        import actiontests
        import uamtests
        import filterstests
        import constraintstests
        import propertiestests
        import serializertests
        import addontests
        suite = unittest.TestSuite()
        suite.addTests(unittest.findTestCases(coretests))
        suite.addTests(unittest.findTestCases(servicestests))
        suite.addTests(unittest.findTestCases(gtkutilstests))
        #suite.addTests(unittest.findTestCases(overlaytests)) # broken
        suite.addTests(unittest.findTestCases(linear_creatortests))
        suite.addTests(unittest.findTestCases(actiontests))
        suite.addTests(unittest.findTestCases(uamtests))
        suite.addTests(unittest.findTestCases(filterstests))
        suite.addTests(unittest.findTestCases(constraintstests))
        suite.addTests(unittest.findTestCases(propertiestests))
        suite.addTests(unittest.findTestCases(serializertests))
        runner = unittest.TextTestRunner()
        runner.run(suite)
        coverage.stop()
        coverage.report(report_files())
        coverage.erase()
    else:
        from coretests import *
        from servicestests import *
        from gtkutilstests import *
        #from overlaytests import * # broken
        from actiontests import *
        from linear_creatortests import *
        from uamtests import *
        from filterstests import *
        from constraintstests import *
        from propertiestests import *
        from actiontests import *
        from serializertests import *
        from addontests import * 
        unittest.main()