-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestall.py
More file actions
67 lines (60 loc) · 2.04 KB
/
testall.py
File metadata and controls
67 lines (60 loc) · 2.04 KB
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
#!/usr/bin/env python2.5
from os.path import join
from subprocess import call
from sys import exit
import setup_config as cfg
TEST_RUNNER_SWF = join(cfg.BASE_DIR, 'SchevoTestRunner.swf')
TESTSERVER_INI = join(cfg.BASE_DIR, 'testserver.ini')
TESTSERVER_PID = join(cfg.BASE_DIR, 'testserver.pid')
SKIP_FLEX_TESTS = True
if __name__ == '__main__':
if not SKIP_FLEX_TESTS:
print '[-] Compiling SchevoTestRunner.mxml.'
result = call([
cfg.MXMLC_EXE,
'-library-path+=%s' % join(cfg.FLEXUNIT, 'bin'),
'-source-path+=%s,%s' % (join(cfg.FLEXCLIENT_DIR, 'src'),
join(cfg.FLEXCLIENT_DIR, 'tests')),
'-output=%s' % TEST_RUNNER_SWF,
'-incremental=true',
'-optimize=true',
'--',
join(cfg.FLEXCLIENT_DIR, 'tests', 'SchevoTestRunner.mxml'),
])
if result != 0:
print '[!] Failed to compile SchevoTestRunner.mxml: %i' % result
exit(result)
print '[-] Starting test server.'
result = call([
'paster',
'serve',
'--daemon',
'--pid-file=%s' % TESTSERVER_PID,
TESTSERVER_INI,
])
if result != 0:
print '[!] Failed to start test server: %i' % result
exit(result)
try:
print '[-] Starting Python tests.'
result = call(['nosetests'])
if result != 0:
print '[!] Python tests failed: %i' % result
exit(result)
print '[+] Python tests pass.'
if not SKIP_FLEX_TESTS:
print '[-] Starting Flash; quit Flash player to finish suite.'
call([
cfg.FLASH_PLAYER_EXE,
TEST_RUNNER_SWF,
])
print '[!] Warning: no test results recorded; continuing.'
finally:
print '[-] Shutting down test server.'
result = call([
'paster',
'serve',
'--stop-daemon',
'--pid-file=%s' % TESTSERVER_PID,
TESTSERVER_INI,
])