File: run_maxq.py

package info (click to toggle)
buildbot 0.7.4-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,968 kB
  • ctags: 3,745
  • sloc: python: 20,806; sh: 194; makefile: 59
file content (47 lines) | stat: -rwxr-xr-x 1,041 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env jython

import sys, glob

testdir = sys.argv[1]

orderfiles = glob.glob(testdir + '/*.tests')

# wee. just be glad I didn't make this one gigantic nested listcomp.
# anyway, this builds a once-nested list of files to test.

#open!
files = [open(fn) for fn in orderfiles]

#create prelim list of lists of files!
files = [f.readlines() for f in files]

#shwack newlines and filter out empties!
files = [filter(None, [fn.strip() for fn in fs]) for fs in files]

#prefix with testdir
files = [[testdir + '/' + fn.strip() for fn in fs] for fs in files]

print "Will run these tests:", files

i = 0

for testlist in files:

    print "==========================="
    print "running tests from testlist", orderfiles[i]
    print "---------------------------"
    i = i + 1
    
    for test in testlist:
        print "running test", test

        try:
            execfile(test, globals().copy())

        except:
            ei = sys.exc_info()
            print "TEST FAILURE:", ei[1]

        else:
            print "SUCCESS"