master/contrib/run_maxq.py
author ffxbld
Tue, 20 May 2014 14:53:03 -0400
branchproduction-0.8
changeset 1033 f6d9311d9246cd18990eaebb6ac4b65e1f569f00
parent 97 c2e02e5bbfdb1c7a463cb44d75b06d45070597d3
permissions -rwxr-xr-x
Added FENNEC_30_0b6_RELEASE FENNEC_30_0b6_BUILD2 tag(s) for changeset production-0.8. DONTBUILD CLOSED TREE a=release

#!/usr/bin/env jython

import sys
import 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"