master/contrib/run_maxq.py
author ffxbld
Thu, 08 Jan 2015 23:25:35 -0500
branchproduction-0.8
changeset 1221 3d67bdd68e436955cba59a437572dbf3e251fe33
parent 97 c2e02e5bbfdb1c7a463cb44d75b06d45070597d3
permissions -rwxr-xr-x
Added FIREFOX_35_0_RELEASE FIREFOX_35_0_BUILD3 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"