Beispiel #1
0
    def _RunControl(self,
                    *args,
                    boards=None,
                    clean_dir=False,
                    test_thread_exceptions=False):
        """Run buildman

        Args:
            args: List of arguments to pass
            boards:
            clean_dir: Used for tests only, indicates that the existing output_dir
                should be removed before starting the build
            test_thread_exceptions: Uses for tests only, True to make the threads
                raise an exception instead of reporting their result. This simulates
                a failure in the code somewhere

        Returns:
            result code from buildman
        """
        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,
            test_thread_exceptions=test_thread_exceptions)
        self._builder = control.builder
        return result
Beispiel #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
Beispiel #3
0
    result = unittest.TestResult()
    test_name = args and args[0] or None
    if skip_net_tests:
        test.use_network = False

    # Run the entry tests first ,since these need to be the first to import the
    # 'entry' module.
    test_util.run_test_suites(result, False, verboose, False, None, test_name,
                              [], [
                                  test.TestBuild, func_test.TestFunctional,
                                  'buildman.toolchain', 'patman.gitutil'
                              ])

    return test_util.report_result('buildman', test_name, result)


options, args = cmdline.ParseArgs()

if not options.debug:
    sys.tracebacklimit = 0

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

# Build selected commits for selected boards
else:
    bsettings.Setup(options.config_file)
    ret_code = control.DoBuildman(options, args)
    sys.exit(ret_code)