Exemple #1
0
 def load_config(self, config, path):
     """load_config(config, path) - Load a config object from an alternate
     path."""
     from TestingConfig import TestingConfig
     return TestingConfig.frompath(path, config.parent, self,
                                   mustExist = True,
                                   config = config)
Exemple #2
0
 def load_config(self, config, path):
     """load_config(config, path) - Load a config object from an alternate
     path."""
     from TestingConfig import TestingConfig
     return TestingConfig.frompath(path, config.parent, self,
                                   mustExist = True,
                                   config = config)
Exemple #3
0
    def search1(path_in_suite):
        # Get the parent config.
        if not path_in_suite:
            parent = ts.config
        else:
            parent = search(path_in_suite[:-1])

        # Load the local configuration.
        source_path = ts.getSourcePath(path_in_suite)
        cfgpath = os.path.join(source_path, kLocalConfigName)
        if litConfig.debug:
            litConfig.note("loading local config %r" % cfgpath)
        return TestingConfig.frompath(cfgpath, parent, litConfig, mustExist=False, config=parent.clone(cfgpath))
Exemple #4
0
    def search1(path_in_suite):
        # Get the parent config.
        if not path_in_suite:
            parent = ts.config
        else:
            parent = search(path_in_suite[:-1])

        # Load the local configuration.
        source_path = ts.getSourcePath(path_in_suite)
        cfgpath = os.path.join(source_path, kLocalConfigName)
        if litConfig.debug:
            litConfig.note('loading local config %r' % cfgpath)
        return TestingConfig.frompath(cfgpath, parent, litConfig,
                                    mustExist = False,
                                    config = parent.clone(cfgpath))
Exemple #5
0
    def search1(path):
        # Check for a site config or a lit config.
        cfgpath = dirContainsTestSuite(path)

        # If we didn't find a config file, keep looking.
        if not cfgpath:
            parent, base = os.path.split(path)
            if parent == path:
                return (None, ())

            ts, relative = search(parent)
            return (ts, relative + (base,))

        # We found a config file, load it.
        if litConfig.debug:
            litConfig.note("loading suite config %r" % cfgpath)

        cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist=True)
        source_root = os.path.realpath(cfg.test_source_root or path)
        exec_root = os.path.realpath(cfg.test_exec_root or path)
        return Test.TestSuite(cfg.name, source_root, exec_root, cfg), ()
Exemple #6
0
    def search1(path):
        # Check for a site config or a lit config.
        cfgpath = dirContainsTestSuite(path)

        # If we didn't find a config file, keep looking.
        if not cfgpath:
            parent, base = os.path.split(path)
            if parent == path:
                return (None, ())

            ts, relative = search(parent)
            return (ts, relative + (base, ))

        # We found a config file, load it.
        if litConfig.debug:
            litConfig.note('loading suite config %r' % cfgpath)

        cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist=True)
        source_root = os.path.realpath(cfg.test_source_root or path)
        exec_root = os.path.realpath(cfg.test_exec_root or path)
        return Test.TestSuite(cfg.name, source_root, exec_root, cfg), ()
Exemple #7
0
    # otherwise from the inputs.
    if not opts.root:
        if opts.config:
            opts.root = os.path.dirname(opts.config)
        else:
            opts.root = os.path.commonprefix([os.path.abspath(p)
                                              for p in inputs])

    # Find the config file, if not specified.
    if not opts.config:
        try:
            opts.config = findConfigPath(opts.root)
        except ValueError,e:
            parser.error(e.args[0])

    cfg = TestingConfig.frompath(opts.config)

    # Update the configuration based on the command line arguments.
    for name in ('PATH','SYSTEMROOT'):
        if name in cfg.environment:
            parser.error("'%s' should not be set in configuration!" % name)

    cfg.root = opts.root
    cfg.environment['PATH'] = os.pathsep.join(opts.path + 
                                                 [os.environ.get('PATH','')])
    cfg.environment['SYSTEMROOT'] = os.environ.get('SYSTEMROOT','')

    if opts.clang is None:
        opts.clang = TestRunner.inferClang(cfg)
    if opts.clangcc is None:
        opts.clangcc = TestRunner.inferClangCC(cfg, opts.clang)
Exemple #8
0
    # otherwise from the inputs.
    if not opts.root:
        if opts.config:
            opts.root = os.path.dirname(opts.config)
        else:
            opts.root = os.path.commonprefix(
                [os.path.abspath(p) for p in inputs])

    # Find the config file, if not specified.
    if not opts.config:
        try:
            opts.config = findConfigPath(opts.root)
        except ValueError, e:
            parser.error(e.args[0])

    cfg = TestingConfig.frompath(opts.config)

    # Update the configuration based on the command line arguments.
    for name in ('PATH', 'SYSTEMROOT'):
        if name in cfg.environment:
            parser.error("'%s' should not be set in configuration!" % name)

    cfg.root = opts.root
    cfg.environment['PATH'] = os.pathsep.join(opts.path +
                                              [os.environ.get('PATH', '')])
    cfg.environment['SYSTEMROOT'] = os.environ.get('SYSTEMROOT', '')

    if opts.clang is None:
        opts.clang = TestRunner.inferClang(cfg)
    if opts.clangcc is None:
        opts.clangcc = TestRunner.inferClangCC(cfg, opts.clang)