Пример #1
0
 def _RunControl(self, *args, **kwargs):
     sys.argv = [sys.argv[0]] + list(args)
     options, args = cmdline.ParseArgs()
     result = control.DoBuildman(options, args, toolchains=self._toolchains,
             make_func=self._HandleMake, boards=self._boards,
             clean_dir=kwargs.get('clean_dir', True))
     self._builder = control.builder
     return result
Пример #2
0
 def _RunControl(self, *args, clean_dir=False, boards=None):
     sys.argv = [sys.argv[0]] + list(args)
     options, args = cmdline.ParseArgs()
     result = control.DoBuildman(options, args, toolchains=self._toolchains,
             make_func=self._HandleMake, boards=boards or self._boards,
             clean_dir=clean_dir)
     self._builder = control.builder
     return result
Пример #3
0
    def _DoBinman(self, *args):
        """Run binman using directly (in the same process)

        Args:
            Arguments to pass, as a list of strings
        Returns:
            Return value (0 for success)
        """
        (options, args) = cmdline.ParseArgs(list(args))
        options.pager = 'binman-invalid-pager'
        options.build_dir = self._indir

        # For testing, you can force an increase in verbosity here
        # options.verbosity = tout.DEBUG
        return control.Binman(options, args)
Пример #4
0
        sys.tracebacklimit = 0

    if args.cmd == 'test':
        if args.test_coverage:
            RunTestCoverage()
        else:
            ret_code = RunTests(args.debug, args.verbosity, args.processes,
                                args.test_preserve_dirs, args.tests,
                                args.toolpath)

    elif args.cmd == 'entry-docs':
        control.WriteEntryDocs(GetEntryModules())

    else:
        try:
            ret_code = control.Binman(args)
        except Exception as e:
            print('binman: %s' % e)
            if args.debug:
                print()
                traceback.print_exc()
            ret_code = 1
    return ret_code


if __name__ == "__main__":
    args = cmdline.ParseArgs(sys.argv[1:])

    ret_code = RunBinman(args)
    sys.exit(ret_code)
Пример #5
0
    result = unittest.TestResult()
    for module in ['toolchain', 'gitutil']:
        suite = doctest.DocTestSuite(module)
        suite.run(result)

    sys.argv = [sys.argv[0]]
    if skip_net_tests:
        test.use_network = False
    for module in (test.TestBuild, func_test.TestFunctional):
        suite = unittest.TestLoader().loadTestsFromTestCase(module)
        suite.run(result)

    print result
    for test, err in result.errors:
        print err
    for test, err in result.failures:
        print err


options, args = cmdline.ParseArgs()

# Run our meagre tests
if options.test:
    RunTests(options.skip_net_tests)

# Build selected commits for selected boards
else:
    bsettings.Setup(options.config_file)
    ret_code = control.DoBuildman(options, args)
    sys.exit(ret_code)
Пример #6
0
    if options.test:
        RunTests()

    elif options.test_coverage:
        RunTestCoverage()

    elif options.full_help:
        pager = os.getenv('PAGER')
        if not pager:
            pager = 'more'
        fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
                             'README')
        command.Run(pager, fname)

    else:
        try:
            ret_code = control.Binman(options, args)
        except Exception as e:
            print 'binman: %s' % e
            if options.debug:
                print
                traceback.print_exc()
            ret_code = 1
    return ret_code


if __name__ == "__main__":
    (options, args) = cmdline.ParseArgs(sys.argv)
    ret_code = RunBinman(options, args)
    sys.exit(ret_code)