Example #1
0
    def setUp(self):
        """setup method. """
        self.command = 'build'
        self.targets = ['test_lex_yacc/...']
        self.target_path = 'test_lex_yacc'
        self.cur_dir = os.getcwd()
        os.chdir('./testdata')
        self.blade_path = '../../blade'
        self.working_dir = '.'
        self.current_building_path = 'build64_release'
        self.current_source_dir = '.'
        self.options = Namespace({
            'm': '64',
            'profile': 'release',
            'generate_dynamic': True,
            'verbose': True
        })
        self.direct_targets = []
        self.all_command_targets = []
        self.related_targets = {}

        # Init global configuration manager
        blade.configparse.blade_config = BladeConfig(self.current_source_dir)
        blade.configparse.blade_config.parse()

        blade.blade.blade = Blade(self.targets,
                                  self.blade_path,
                                  self.working_dir,
                                  self.current_building_path,
                                  self.current_source_dir,
                                  self.options,
                                  blade_command=self.command)
        self.blade = blade.blade.blade
        (self.direct_targets,
         self.all_command_targets) = self.blade.load_targets()
Example #2
0
    def doSetUp(self,
                path,
                target='...',
                full_targets=None,
                command='build',
                generate_php=True,
                **kwargs):
        """setup method. """
        self.command = 'build'
        if full_targets:
            self.targets = full_targets
        else:
            self.targets = ['%s:%s' % (path, target)]
        self.target_path = path
        self.cur_dir = os.getcwd()
        os.chdir('./testdata')
        self.blade_path = '../../blade'
        self.working_dir = '.'
        self.current_building_path = 'build64_release'
        self.current_source_dir = '.'
        options = {
            'arch': 'x86_64',
            'm': '64',
            'profile': 'release',
            'generate_dynamic': True,
            'generate_java': True,
            'generate_php': generate_php,
            'verbose': True
        }
        options.update(kwargs)
        self.options = Namespace(**options)
        self.direct_targets = []
        self.all_command_targets = []
        self.related_targets = {}

        # Init global configuration manager
        blade.configparse.blade_config = BladeConfig()
        config = blade.configparse.blade_config
        config.try_parse_file(
            os.path.join(os.path.dirname(sys.argv[0]), 'blade.conf'))
        config.try_parse_file(os.path.expanduser('~/.bladerc'))
        config.try_parse_file(os.path.join('.', 'BLADE_ROOT'))

        blade.blade.blade = Blade(self.targets, self.blade_path,
                                  self.working_dir, self.current_building_path,
                                  self.current_source_dir, self.options,
                                  self.command)
        self.blade = blade.blade.blade
        (self.direct_targets,
         self.all_command_targets) = self.blade.load_targets()
        self.blade.analyze_targets()
        self.all_targets = self.blade.get_build_targets()
        self.scons_output_file = 'scons_output.txt'
Example #3
0
    def setUp(self):
        """setup method. """
        self.command = 'build'
        self.targets = ['test_test_runner:string_test_main']
        self.target_path = 'test_test_runner'
        self.cur_dir = os.getcwd()
        os.chdir('./testdata')
        self.blade_path = '../../blade'
        self.working_dir = '.'
        self.current_building_path = 'build64_release'
        self.current_source_dir = '.'
        self.options = Namespace({'m' : '64',
                                  'profile' : 'release',
                                  'generate_dynamic' : True,
                                  'args' : '',
                                  'test_jobs' : 1,
                                  'show_details' : True,
                                  'fulltest' : False
                                 })
        self.direct_targets = []
        self.all_command_targets = []
        self.related_targets = {}

        # Init global configuration manager
        blade.configparse.blade_config = BladeConfig(self.current_source_dir)
        blade.configparse.blade_config.parse()

        blade.blade.blade = Blade(self.targets,
                                  self.blade_path,
                                  self.working_dir,
                                  self.current_building_path,
                                  self.current_source_dir,
                                  self.options,
                                  blade_command=self.command)
        self.blade = blade.blade.blade
        (self.direct_targets,
         self.all_command_targets) = self.blade.load_targets()
        self.blade.analyze_targets()
        self.all_targets = self.blade.get_all_targets_expanded()