Ejemplo n.º 1
0
 def test(self):
     """Run tests. """
     skip_tests = []
     if self.__options.skip_tests:
         skip_tests = target.normalize(self.__options.skip_tests.split(','),
                                       self.__working_dir)
     test_runner = TestRunner(self.__build_targets, self.__options,
                              self.__target_database, self.__direct_targets,
                              skip_tests)
     return test_runner.run()
Ejemplo n.º 2
0
 def test(self):
     """Run tests. """
     skip_tests = []
     if self.__options.skip_tests:
         skip_tests = target.normalize(self.__options.skip_tests.split(','), self.__working_dir)
     test_runner = TestRunner(self.__build_targets,
                              self.__options,
                              self.__target_database,
                              self.__direct_targets,
                              skip_tests)
     return test_runner.run()
Ejemplo n.º 3
0
 def test(self):
     """Run tests. """
     exclude_tests = []
     if self.__options.exclude_tests:
         exclude_tests = target.normalize(
             self.__options.exclude_tests.split(','), self.__working_dir)
     test_runner = TestRunner(self.__options, self.__target_database,
                              self.__direct_targets,
                              self.__expanded_command_targets,
                              self.__build_targets, exclude_tests,
                              self.test_jobs_num())
     return test_runner.run()
Ejemplo n.º 4
0
 def _parse_qyery_path_to(self):
     """Parse the `--path-to` command line argument"""
     if not self.__options.query_path_to:
         return set()
     result = set()
     for id in target.normalize(self.__options.query_path_to.split(','),
                                self.__working_dir):
         if id not in self.__target_database:
             console.fatal(
                 'Invalid argument: "--path_to=%s", target "%s" does not exist'
                 % (self.__options.query_path_to, id))
             result.add(id)
     return result
Ejemplo n.º 5
0
def _main(blade_path, argv):
    """The main entry of blade."""
    command, options, targets = command_line.parse(argv)
    setup_console(options)

    global _BLADE_ROOT_DIR
    global _WORKING_DIR
    _BLADE_ROOT_DIR, _WORKING_DIR = get_source_dirs()
    if _BLADE_ROOT_DIR != _WORKING_DIR:
        # This message is required by vim quickfix mode if pwd is changed during
        # the building, DO NOT change the pattern of this message.
        if options.verbosity != 'quiet':
            print("Blade: Entering directory `%s'" % _BLADE_ROOT_DIR)
        os.chdir(_BLADE_ROOT_DIR)

    load_config(options, _BLADE_ROOT_DIR)
    adjust_config_by_options(config, options)
    if _check_error_log('config'):
        return 1

    global _TARGETS
    if not targets:
        targets = ['.']
    targets = target.normalize(targets, _WORKING_DIR)
    _TARGETS = targets

    build_dir = setup_build_dir(options)
    setup_log(build_dir, options)

    generate_scm(build_dir)

    lock_file_fd = lock_workspace(build_dir)
    try:
        if options.profiling:
            return run_subcommand_profile(command, options, targets,
                                          blade_path, build_dir)
        return run_subcommand(command, options, targets, blade_path, build_dir)
    finally:
        unlock_workspace(lock_file_fd)
Ejemplo n.º 6
0
def _main(blade_path):
    """The main entry of blade. """
    command, options, targets = parse_command_line()
    setup_console(options)

    global _BLADE_ROOT_DIR
    global _WORKING_DIR
    _BLADE_ROOT_DIR, _WORKING_DIR = get_source_dirs()
    if _BLADE_ROOT_DIR != _WORKING_DIR:
        # This message is required by vim quickfix mode if pwd is changed during
        # the building, DO NOT change the pattern of this message.
        if options.verbosity != 'quiet':
            print("Blade: Entering directory `%s'" % _BLADE_ROOT_DIR)
        os.chdir(_BLADE_ROOT_DIR)

    load_config(options, _BLADE_ROOT_DIR)
    adjust_config_by_options(config, options)

    global _TARGETS
    if not targets:
        targets = ['.']
    targets = target.normalize(targets, _WORKING_DIR)
    _TARGETS = targets

    build_dir = setup_build_dir(options)
    setup_log(build_dir, options)

    generate_scm(build_dir)

    lock_file_fd = lock_workspace()
    try:
        if options.profiling:
            return run_subcommand_profile(command, options, targets, blade_path, build_dir)
        return run_subcommand(command, options, targets, blade_path, build_dir)
    finally:
        unlock_workspace(lock_file_fd)