Changeset d3d771e in rtems-tools for tester/rt/check.py


Ignore:
Timestamp:
Nov 30, 2016, 11:21:13 PM (3 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
a72a462a
Parents:
8a7be63
Message:

bsp-builder: Add support for builds.

Add build support where a build is a combination of options. The
default is 'all' which is a full set of build options passed to
configure. You can now use 'basic' which is the standard or default
configure command line. This used with the arch option lets you
quickly build all BSPs in an architecture.

For example:

$ rtems-bsp-builder --build-path /builds/rtems/builds/arm \

--rtems-tools /opt/rtems/4.12 \
--rtems /opt/rtems/src/rtems.git \
--arch arm --build basic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/check.py

    r8a7be63 rd3d771e  
    202202        return sorted(set([a.strip() for a in items.split(',')]))
    203203
    204     def load(self, name):
     204    def load(self, name, variation):
    205205        if not path.exists(name):
    206206            raise error.general('config: cannot read configuration: %s' % (name))
     
    242242        builds['default'] = self._get_item('builds', 'default').split()
    243243        builds['variations'] = self._comma_list('builds', 'variations')
     244        if variation is None:
     245            variation = builds['default']
     246        builds['variation'] = variation
     247        builds['base'] = self._get_item('builds', 'standard').split()
     248        builds['variations'] = self._comma_list('builds', variation)
    244249        builds['var_options'] = {}
    245250        for v in builds['variations']:
    246             builds['var_options'][v] = self._get_item('builds', v).split()
     251            if v == 'base':
     252                builds['var_options'][v] = self._get_item('builds', v).split()
     253            else:
     254                builds['var_options'][v] = []
    247255        self.builds = builds
    248256
     
    279287        return self.archs[arch][bsp]['bspopts']
    280288
    281     def defaults(self):
    282         return self.builds['default']
     289    def base(self):
     290        return self.builds['base']
    283291
    284292    def variant_options(self, variant):
     
    371379    def _build_set(self, variations):
    372380        build_set = { }
    373         bs = self.config.defaults()
     381        bs = self.config.base()
    374382        for var in variations:
    375383            build_set[var] = bs + self.config.variant_options(var)
     
    456464                            raise error.general('Building %s failed' % (bs))
    457465                    files = self._count_files(arch, bsp, bs)
    458                 log.notice('%s: %s: warnings:%d  exes:%d  objs:%s  libs:%d' % \
    459                            (result, bs, warnings.get(),
    460                             files['exes'], files['objs'], files['libs']))
     466                    log.notice('%s: %s: warnings:%d  exes:%d  objs:%s  libs:%d' % \
     467                               (result, bs, warnings.get(),
     468                                files['exes'], files['objs'], files['libs']))
    461469                log.notice('  %s' % (self._error_str()))
    462470                self.results.add(result[0] == '+', arch, bsp, config_cmd, warnings.get())
     
    549557        argsp.add_argument('--build-path', help = 'Path to build in.', type = str)
    550558        argsp.add_argument('--log', help = 'Log file.', type = str)
    551         argsp.add_argument('--stop-on-error', help = 'Stop on an error.', action = 'store_true')
    552         argsp.add_argument('--no-clean', help = 'Do not clean the build output.', action = 'store_true')
    553         argsp.add_argument('--profiles', help = 'Build the listed profiles.', type = str, default = 'tier-1')
     559        argsp.add_argument('--stop-on-error', help = 'Stop on an error.',
     560                           action = 'store_true')
     561        argsp.add_argument('--no-clean', help = 'Do not clean the build output.',
     562                           action = 'store_true')
     563        argsp.add_argument('--profiles', help = 'Build the listed profiles.',
     564                           type = str, default = 'tier-1')
     565        argsp.add_argument('--build', help = 'Build variation.', type = str)
    554566        argsp.add_argument('--arch', help = 'Build the specific architecture.', type = str)
    555567        argsp.add_argument('--bsp', help = 'Build the specific BSP.', type = str)
    556         argsp.add_argument('--dry-run', help = 'Do not run the actual builds.', action = 'store_true')
     568        argsp.add_argument('--dry-run', help = 'Do not run the actual builds.',
     569                           action = 'store_true')
    557570
    558571        opts = argsp.parse_args(args[1:])
     
    573586
    574587        config = configuration()
    575         config.load(config_file)
     588        config.load(config_file, opts.build)
    576589
    577590        options = { 'stop-on-error' : opts.stop_on_error,
     
    580593                    'jobs'          : 8 }
    581594
    582         b = build(config, rtems_version(), prefix, tools, path.shell(opts.rtems), build_dir, options)
     595        b = build(config, rtems_version(), prefix, tools,
     596                  path.shell(opts.rtems), build_dir, options)
    583597        if opts.arch is not None:
    584598            if opts.bsp is not None:
Note: See TracChangeset for help on using the changeset viewer.