Exemplo n.º 1
0
for fname in logconfFileNames:
    logging.config.fileConfig(fname)
else:
    logging.basicConfig()
    
LOG = logging.getLogger('doxscript')

try:
    import time
    LOG.info("Running doxscript at %s" % time.asctime())

    # svn
    svndoug = svnscripts.run(confFileNames)

    # autotools
    autotools.run(confFileNames)

    # doxygen 
    LOG.info("Preparing to run doxygen")
    import popen2
    import os

    conf = SafeConfigParser()
    conf.readfp(StringIO(defaultConfig))
    conf.read(confFileNames)

    cmd = conf.get('doxscript', 'doxygen')
    docdir = conf.get('doxscript', 'docdir')
    docdirhtml = conf.get('doxscript', 'docdirhtml')
    outfname = conf.get('doxscript', 'doxygen-outfilename')
    errfname = conf.get('doxscript', 'doxygen-errfilename')
Exemplo n.º 2
0
def main(testResults):    
    # svn
    if conf.getboolean('testscript', 'run-svn'):
        svndoug = svnscripts.run(confFileNames, conf.defaults())

    # autotools
    if conf.getboolean('testscript', 'run-autotools'):
        autotools.run(confFileNames, conf.defaults())

    
    # construct tests

    if conf.getboolean('testscript', 'run-tests'):
        testSuite = unittest.TestSuite()
        items = conf.items("tests")
        for name, value in items:
            if not name.startswith("test"): continue
            tname = name[4:]

            # read test data
            ctrlfname, solutionfname, testconfs = tuple(value.strip().split(" ", 2))
            ctrlfname = os.path.abspath(ctrlfname)
            solutionfname = os.path.abspath(solutionfname)
            datadir = os.path.dirname(ctrlfname)
            LOG.debug("Constructing test '%s'" % (tname, ))
            LOG.debug("Control file: %s" % ctrlfname)
            LOG.debug("Correct solution file: %s" % (solutionfname,))

            # read test configurations
            testconfs = testconfs.split(",")
            for testconf in testconfs:
                testconfname = "testconf_%s" % testconf
                testname = "%s_%s" % (tname, testconf)
                solvers = map(int, conf.get(testconfname, "solver").split(","))
                methods = map(int, conf.get(testconfname, "method").split(","))
                levels = map(int, conf.get(testconfname, "levels").split(","))
                fine_methods = map(int, conf.get(testconfname, "fine_methods").split(","))
                nsubdomains = map(int, conf.get(testconfname, "num_subdomains").split(","))
                processors = map(int, conf.get(testconfname, "processors").split(","))
                executables = conf.get(testconfname, "executables").split(",")
                overlaps = map(int, conf.get(testconfname, "overlaps").split(","))
                smoothers = map(int, conf.get(testconfname, "smoothers").split(","))

                testtuples = generateTuples(solvers, methods, levels, fine_methods, nsubdomains, processors, executables, overlaps, smoothers)

                for solver,method,level,fine_method, nsubdomain,nproc,executable,overlap,smoother in testtuples:
                    dougControlFile = doug.execution.ControlFile(filename=ctrlfname, basedir=os.path.dirname(ctrlfname))
                    dougConfig = DOUGConfigParser(name='DOUG execution parameters')
                    # set/copy doug configuration from tests configuration
                    dougConfig.add_section('doug')
                    for name,value in conf.items('doug', raw=True):
                        dougConfig.set('doug', name, value)
                    dougConfig.add_section('doug-controls')
                    for name,value in conf._sections['doug-controls'].items():
                        dougConfig.set('doug-controls', name, value)
                    dougConfig.add_section('doug-tests')
                    dougConfig.set('doug-tests', 'csolution_file', solutionfname)
                    # set test configuration
                    dougConfig.set('doug-controls', 'solver', str(solver))
                    dougConfig.set('doug-controls', 'method', str(method))
                    dougConfig.set('doug-controls', 'levels', str(level))
                    dougConfig.set('doug-controls', 'fine_method', str(fine_method))
                    dougConfig.set('doug-controls', 'num_subdomains', str(nsubdomain))
                    dougConfig.set('doug', 'nproc', str(nproc))
                    dougConfig.set('doug', 'executable', executable)
                    dougConfig.set('doug-controls', 'overlap', str(overlap))
                    dougConfig.set('doug-controls', 'smoothers', str(smoother))

                    # create DOUG execution object
                    execution = doug.execution.DOUGExecution(dougConfig, dougControlFile)
                    test = dougtest.TestCase(execution, testname)
                    #resultConfig=execution.run()
                    
                    #test = dougtest.MPITestCase(name+"_"+testconf, datadir, ctrlfname, solutionfname, conf, *testtuple)
                    testSuite.addTest(test)

        # run tests
        testRunner = dougtest.TestRunner(testResults)
        testRunner.run(testSuite)