Back to index

enigmail  1.4.3
Classes | Functions | Variables
runtests Namespace Reference

Classes

class  ParentDict
class  TestParser
class  CheckXPTDump
class  TestIIDString
class  TypelibCompareMixin
class  TestTypelibRoundtrip
class  TestInterfaceCmp
class  TestTypelibMerge
class  TestXPTLink

Functions

def runTest
def get_output

Variables

tuple thisdir = os.path.dirname(os.path.abspath(__file__))
list pymake = [sys.executable, os.path.join(os.path.dirname(thisdir), 'make.py')]
tuple manifest = os.path.join(thisdir, 'tests.manifest')
tuple o = OptionParser()
string dest = "gmake"
list args = [thisdir]
list makefiles = []
int gmakefails = 0
int pymakefails = 0
tuple tre = re.compile('^#T (gmake |pymake )?([a-z-]+)(?:: (.*))?$')
list cline = ['-C', opts.tempdir, '-f', os.path.abspath(makefile), 'TESTPATH=%s' % thisdir.replace('\\','/'), 'NATIVE_TESTPATH=%s' % thisdir]
dictionary options
tuple gmakeoptions = ParentDict(options)
tuple pymakeoptions = ParentDict(options)
dictionary dmap = {None: options, 'gmake ': gmakeoptions, 'pymake ': pymakeoptions}
tuple mdata = open(makefile)
tuple line = line.strip()
tuple m = tre.search(line)
list d = dmap[make]
tuple data = eval(data)
string gmakemsg = "UNEXPECTED PASS"
string pymakemsg = "UNEXPECTED PASS"

Function Documentation

def runtests.get_output (   bin,
  file 
)

Definition at line 43 of file runtests.py.

00043 
00044 def get_output(bin, file):
00045     p = subprocess.Popen([bin, file], stdout=subprocess.PIPE)
00046     stdout, _ = p.communicate()
00047     return stdout

Here is the caller graph for this function:

def runtests.runTest (   makefile,
  make,
  logfile,
  options 
)
Given a makefile path, test it with a given `make` and return
(pass, message).

Definition at line 59 of file runtests.py.

00059 
00060 def runTest(makefile, make, logfile, options):
00061     """
00062     Given a makefile path, test it with a given `make` and return
00063     (pass, message).
00064     """
00065 
00066     if os.path.exists(opts.tempdir): shutil.rmtree(opts.tempdir)
00067     os.mkdir(opts.tempdir, 0755)
00068 
00069     logfd = open(logfile, 'w')
00070     p = Popen(make + options['commandline'], stdout=logfd, stderr=STDOUT, env=options['env'])
00071     logfd.close()
00072     retcode = p.wait()
00073 
00074     if retcode != options['returncode']:
00075         return False, "FAIL (returncode=%i)" % retcode
00076         
00077     logfd = open(logfile)
00078     stdout = logfd.read()
00079     logfd.close()
00080 
00081     if stdout.find('TEST-FAIL') != -1:
00082         print stdout
00083         return False, "FAIL (TEST-FAIL printed)"
00084 
00085     if options['grepfor'] and stdout.find(options['grepfor']) == -1:
00086         print stdout
00087         return False, "FAIL (%s not in output)" % options['grepfor']
00088 
00089     if options['returncode'] == 0 and stdout.find('TEST-PASS') == -1:
00090         print stdout
00091         return False, 'FAIL (No TEST-PASS printed)'
00092 
00093     if options['returncode'] != 0:
00094         return True, 'PASS (retcode=%s)' % retcode
00095 
00096     return True, 'PASS'


Variable Documentation

Definition at line 50 of file runtests.py.

list runtests.cline = ['-C', opts.tempdir, '-f', os.path.abspath(makefile), 'TESTPATH=%s' % thisdir.replace('\\','/'), 'NATIVE_TESTPATH=%s' % thisdir]

Definition at line 107 of file runtests.py.

list runtests.d = dmap[make]

Definition at line 135 of file runtests.py.

tuple runtests.data = eval(data)

Definition at line 137 of file runtests.py.

string runtests.dest = "gmake"

Definition at line 44 of file runtests.py.

dictionary runtests.dmap = {None: options, 'gmake ': gmakeoptions, 'pymake ': pymakeoptions}

Definition at line 125 of file runtests.py.

Definition at line 99 of file runtests.py.

string runtests.gmakemsg = "UNEXPECTED PASS"

Definition at line 173 of file runtests.py.

Definition at line 122 of file runtests.py.

tuple runtests.line = line.strip()

Definition at line 129 of file runtests.py.

tuple runtests.m = tre.search(line)

Definition at line 130 of file runtests.py.

list runtests.makefiles = []

Definition at line 52 of file runtests.py.

tuple runtests.manifest = os.path.join(thisdir, 'tests.manifest')

Definition at line 40 of file runtests.py.

tuple runtests.mdata = open(makefile)

Definition at line 127 of file runtests.py.

tuple runtests.o = OptionParser()

Definition at line 42 of file runtests.py.

dictionary runtests.options
Initial value:
00001 {
00002         'returncode': 0,
00003         'grepfor': None,
00004         'env': dict(os.environ),
00005         'commandline': cline,
00006         'pass': True,
00007         'skip': False,
00008         }

Definition at line 113 of file runtests.py.

list runtests.pymake = [sys.executable, os.path.join(os.path.dirname(thisdir), 'make.py')]

Definition at line 39 of file runtests.py.

Definition at line 100 of file runtests.py.

string runtests.pymakemsg = "UNEXPECTED PASS"

Definition at line 189 of file runtests.py.

Definition at line 123 of file runtests.py.

tuple runtests.thisdir = os.path.dirname(os.path.abspath(__file__))

Definition at line 37 of file runtests.py.

tuple runtests.tre = re.compile('^#T (gmake |pymake )?([a-z-]+)(?:: (.*))?$')

Definition at line 102 of file runtests.py.