Changeset 9a8a03c in rtems-tools


Ignore:
Timestamp:
May 15, 2017, 1:29:46 AM (2 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
ef38b5d
Parents:
85e14e0
Message:

rtems-bsp-builder: Add all architectures and BSPs.

  • Add support to include other INI files.
  • Add support for extended interpolation on Python 2.7.
Location:
tester
Files:
17 added
2 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/check.py

    r85e14e0 r9a8a03c  
    446446        self.config = configparser.ConfigParser()
    447447        self.name = None
     448        self.ini = None
    448449        self.archs = { }
    449450        self.builds_ = { }
    450451        self.profiles = { }
    451452        self.configurations = { }
     453        self.macro_filter = re.compile('\$\{.+\}')
    452454
    453455    def __str__(self):
     
    465467        try:
    466468            rec = self.config.get(section, label).replace(os.linesep, ' ')
    467             return rec
    468469        except:
    469470            if err:
    470471                raise error.general('config: no "%s" found in "%s"' % (label, section))
    471         return None
     472            return None
     473        #
     474        # On Python 2.7 there is no extended interpolation so add support here.
     475        # On Python 3 this should happen automatically and so the findall
     476        # should find nothing.
     477        #
     478        for m in self.macro_filter.findall(rec):
     479            if ':' not in m:
     480                raise error.general('config: interpolation is ${section:value}: %s' % (m))
     481            section_value = m[2:-1].split(':')
     482            if len(section_value) != 2:
     483                raise error.general('config: interpolation is ${section:value}: %s' % (m))
     484            try:
     485                ref = self.config.get(section_value[0],
     486                                      section_value[1]).replace(os.linesep, ' ')
     487                rec = rec.replace(m, ref)
     488            except:
     489                pass
     490        return rec
    472491
    473492    def _get_items(self, section, err = True):
     
    481500        return []
    482501
    483     def _comma_list(self, section, label, error = True):
    484         items = self._get_item(section, label, error)
     502    def _comma_list(self, section, label, err = True):
     503        items = self._get_item(section, label, err)
    485504        if items is None:
    486505            return []
     
    494513                raise error.general('config: section "%s" not found' % (section))
    495514        return []
     515
     516    def _load(self, name):
     517        #
     518        # Load all the files.
     519        #
     520        self.ini = { 'base'     : path.dirname(name),
     521                     'files'    : [] }
     522        includes = [name]
     523        still_loading = True
     524        while still_loading:
     525            still_loading = False
     526            for include in includes:
     527                if not path.exists(include):
     528                    rebased_inc = path.join(self.ini['base'],
     529                                            path.basename(include))
     530                    if not path.exists(rebased_inc):
     531                        e = 'config: cannot find configuration: %s' % (include)
     532                        raise error.general(e)
     533                    include = rebased_inc
     534                if include not in self.ini['files']:
     535                    try:
     536                        self.config.read(include)
     537                    except configparser.ParsingError as ce:
     538                        raise error.general('config: %s' % (ce))
     539                    still_loading = True
     540                    self.ini['files'] += [include]
     541            includes = []
     542            if still_loading:
     543                for section in self.config.sections():
     544                    includes += self._comma_list(section, 'include', err = False)
    496545
    497546    def _build_options(self, build, nesting = 0):
     
    518567
    519568    def load(self, name, build):
    520         if not path.exists(name):
    521             raise error.general('config: cannot read configuration: %s' % (name))
    522         self.name = name
    523         try:
    524             self.config.read(name)
    525         except configparser.ParsingError as ce:
    526             raise error.general('config: %s' % (ce))
     569        self._load(name)
    527570        archs = []
    528         self.profiles['profiles'] = self._comma_list('profiles', 'profiles', error = False)
     571        self.profiles['profiles'] = self._comma_list('profiles', 'profiles', err = False)
    529572        if len(self.profiles['profiles']) == 0:
    530573            self.profiles['profiles'] = ['tier-%d' % (t) for t in range(1,4)]
     
    541584            arch = {}
    542585            arch['excludes'] = {}
    543             for exclude in self._comma_list(a, 'exclude', error = False):
     586            for exclude in self._comma_list(a, 'exclude', err = False):
    544587                arch['excludes'][exclude] = ['all']
    545588            for i in self._get_items(a, False):
     
    549592                        arch['excludes'][exclude] = []
    550593                    arch['excludes'][exclude] += sorted(set([b.strip() for b in i[1].split(',')]))
    551             arch['bsps'] = self._comma_list(a, 'bsps', error = False)
     594            arch['bsps'] = self._comma_list(a, 'bsps', err = False)
    552595            for b in arch['bsps']:
    553596                arch[b] = {}
    554                 arch[b]['bspopts'] = self._comma_list(a, 'bspopts_%s' % (b), error = False)
     597                arch[b]['bspopts'] = self._comma_list(a, 'bspopts_%s' % (b), err = False)
    555598            self.archs[a] = arch
    556599        builds = {}
     
    638681        cols_2 = [10, width - 10]
    639682        s = textbox.line(cols_1, line = '=', marker = '+', indent = 1)
    640         s1 = ' File'
    641         colon = ':'
    642         for l in textwrap.wrap(self.name, width = cols_2[1] - 3):
    643             s += textbox.row(cols_2, [s1, ' ' + l], marker = colon, indent = 1)
    644             colon = ' '
    645             s1 = ' ' * len(s1)
     683        s1 = ' File(s)'
     684        for f in self.ini['files']:
     685            colon = ':'
     686            for l in textwrap.wrap(f, width = cols_2[1] - 3):
     687                s += textbox.row(cols_2, [s1, ' ' + l], marker = colon, indent = 1)
     688                colon = ' '
     689                s1 = ' ' * len(s1)
    646690        s += textbox.line(cols_1, marker = '+', indent = 1)
    647691        s += os.linesep
     
    649693            s += textbox.line(cols_1, line = '=', marker = '+', indent = 1)
    650694            profiles = sorted(self.profiles['profiles'])
    651             bsps = 0
     695            archs = []
     696            bsps = []
    652697            for profile in profiles:
    653                 archs = sorted(self.profiles[profile]['archs'])
    654                 for arch in archs:
    655                     bsps += len(self.profiles[profile]['bsps_%s' % (arch)])
     698                archs += self.profiles[profile]['archs']
     699                for arch in sorted(self.profiles[profile]['archs']):
     700                    bsps += self.profiles[profile]['bsps_%s' % (arch)]
     701            archs = len(set(archs))
     702            bsps = len(set(bsps))
    656703            s += textbox.row(cols_1,
    657                              [' Profiles : %d/%d' % (len(archs), bsps)],
     704                             [' Profiles : %d (archs:%d, bsps:%d)' % \
     705                              (len(profiles), archs, bsps)],
    658706                             indent = 1)
    659707            for profile in profiles:
     
    667715                archs = sorted(profile['archs'])
    668716                for arch in archs:
    669                     s += textbox.line(cols_2, marker = '+', indent = 1)
    670                     s1 = ' ' + arch
    671                     for l in textwrap.wrap(', '.join(profile['bsps_%s' % (arch)]),
    672                                            width = cols_2[1] - 2):
    673                         s += textbox.row(cols_2, [s1, ' ' + l], indent = 1)
    674                         s1 = ' ' * len(s1)
     717                    arch_bsps = ', '.join(profile['bsps_%s' % (arch)])
     718                    if len(arch_bsps) > 0:
     719                        s += textbox.line(cols_2, marker = '+', indent = 1)
     720                        s1 = ' ' + arch
     721                        for l in textwrap.wrap(arch_bsps,
     722                                               width = cols_2[1] - 3):
     723                            s += textbox.row(cols_2, [s1, ' ' + l], indent = 1)
     724                            s1 = ' ' * len(s1)
    675725                s += textbox.line(cols_2, marker = '+', indent = 1)
    676726            s += os.linesep
     
    690740                s1 = ' ' + build
    691741                for l in textwrap.wrap(', '.join(builds[build]),
    692                                        width = cols_b[1] - 2):
     742                                       width = cols_b[1] - 3):
    693743                    s += textbox.row(cols_b, [s1, ' ' + l], indent = 1)
    694744                    s1 = ' ' * len(s1)
  • tester/rtems/rtems-bsps.ini

    r85e14e0 r9a8a03c  
    1919
    2020[profiles]
    21 profiles = tier-1, tier-2, tier-3, tier-4
     21profiles = tier-1, tier-2, tier-3, tier-4, everything
    2222
    2323#
    24 # Tier 1: no build errors and no unexpected tests failures on hardware.
     24# Define how each profile is to be treated. Note, hardware vs simulator testing
     25# is handled in the configuration, there is not specific test to determine
     26# this.
    2527#
    26 [tier-1]
    27 archs = arm, i386, sparc
    28 bsps_arm = altcycv_devkit,
    29     altcycv_devkit_smp,
    30     xilinx_zynq_zc702, xilinx_zynq_zc706, xilinx_zynq_zedboard
    31 bsps_i386 = pc686
    32 bsps_sparc = leon2, leon3
     28[tier-1-profile]
     29active = Yes
     30build = Yes
     31tests = Yes
     32
     33[tier-2-profile]
     34active = Yes
     35build = Yes
     36tests = Yes
     37
     38[tier-3-profile]
     39active = Yes
     40build = Yes
     41tests = No
     42
     43[tier-4-profile]
     44active = No
     45build = No
     46tests = No
     47
     48[everything-profile]
     49active = Yes
     50build = Yes
     51tests = No
    3352
    3453#
    35 # Tier 2: no build errors and no unexpected tests failures on hardware and
    36 #         simulators.
     54# Tiers.
    3755#
    38 [tier-2]
    39 archs = arm, sparc
    40 bsps_arm = lm3s6965_qemu,
    41     realview_pbx_a9_qemu, realview_pbx_a9_qemu_smp,
    42     xilinx_zynq_a9_qemu
    43 bsps_sparc = erc32
    44 #
    45 # Tier 3: no build errors, no tests run.
    46 #
    47 [tier-3]
    48 archs = arm, moxie
    49 bsps_arm = arm1136jfs,
    50     arm1136js, arm7tdmi, arm920, armcortexa9, atsamv,
    51     beagleboardorig, beagleboardxm, beagleboneblack, beaglebonewhite,
    52     csb336, csb337, csb637,
    53     edb7312,
    54     kit637_v6,
    55     gumstix,
    56     lm3s3749, lm3s6965, lm4f120,
    57     lpc1768_mbed, lpc1768_mbed_ahb_ram, lpc1768_mbed_ahb_ram_eth,
    58     lpc17xx_ea_ram, lpc17xx_ea_rom_int, lpc17xx_plx800_ram,
    59     lpc17xx_plx800_rom_int, lpc2362, lpc23xx_tli800, lpc24xx_ea,
    60     lpc24xx_ncs_ram, lpc24xx_ncs_rom_ext, lpc24xx_ncs_rom_int,
    61     lpc24xx_plx800_ram, lpc24xx_plx800_rom_int, lpc40xx_ea_ram,
    62     lpc40xx_ea_rom_int, lpc32xx_mzx, lpc32xx_mzx_stage_1,
    63     lpc32xx_mzx_stage_2, lpc32xx_phycore,
    64     raspberrypi, raspberrypi2,
    65     rtl22xx, rtl22xx_t,
    66     smdk2410,
    67     stm32f105rc, stm32f4,
    68     tms570ls3137_hdk, tms570ls3137_hdk_intram,
    69     tms570ls3137_hdk_sdram,
    70     tms570ls3137_hdk_with_loader
    71 bsps_moxie = moxiesim
     56[tiers]
     57include = rtems-bsps-tiers.ini
    7258
    7359#
    74 # Tier 4: nothing expected.
     60# All the architectures and BSPs.
    7561#
    76 [tier-4]
    77 archs = epiphany
    78 bsps_epiphany = epiphany_sim
     62[everything]
     63archs = arm,
     64        bfin,
     65        epiphany,
     66        i386,
     67        lm32,
     68        m32c,
     69        m68k,
     70        mips,
     71        moxie,
     72        or1k,
     73        powerpc,
     74        sh,
     75        sparc,
     76        sparc64,
     77        v850
     78bsps_arm = ${arm:bsps}
     79bsps_bfin = ${bfin:bsps}
     80bsps_epiphany = ${epiphany:bsps}
     81bsps_i386 = ${i386:bsps}
     82bsps_lm32 = ${lm32:bsps}
     83bsps_m32c = ${m32c:bsps}
     84bsps_m68k = ${m68k:bsps}
     85bsps_mips = ${mips:bsps}
     86bsps_moxie = ${moxie:bsps}
     87bsps_or1k = ${or1k:bsps}
     88bsps_powerpc = ${powerpc:bsps}
     89bsps_sh = ${sh:bsps}
     90bsps_sparc = ${sparc:bsps}
     91bsps_sparc64 = ${sparc64:bsps}
     92bsps_v850 = ${v850:bsps}
    7993
    8094#
    8195# Architectures
    8296#
    83 [arm]
    84 bsps = altcycv_devkit,
    85     altcycv_devkit_smp,
    86     arm1136jfs, arm1136js, arm7tdmi, arm920, armcortexa9, atsamv,
    87     beagleboardorig, beagleboardxm, beagleboneblack, beaglebonewhite,
    88     csb336, csb337, csb637,
    89     edb7312,
    90     kit637_v6,
    91     gumstix,
    92     lm3s3749, lm3s6965, lm3s6965_qemu, lm4f120,
    93     lpc1768_mbed, lpc1768_mbed_ahb_ram, lpc1768_mbed_ahb_ram_eth,
    94     lpc17xx_ea_ram, lpc17xx_ea_rom_int, lpc17xx_plx800_ram,
    95     lpc17xx_plx800_rom_int, lpc2362, lpc23xx_tli800, lpc24xx_ea,
    96     lpc24xx_ncs_ram, lpc24xx_ncs_rom_ext, lpc24xx_ncs_rom_int,
    97     lpc24xx_plx800_ram, lpc24xx_plx800_rom_int, lpc40xx_ea_ram,
    98     lpc40xx_ea_rom_int, lpc32xx_mzx, lpc32xx_mzx_stage_1,
    99     lpc32xx_mzx_stage_2, lpc32xx_phycore,
    100     raspberrypi, raspberrypi2,
    101     realview_pbx_a9_qemu, realview_pbx_a9_qemu_smp,
    102     rtl22xx, rtl22xx_t,
    103     smdk2410,
    104     stm32f105rc, stm32f4,
    105     tms570ls3137_hdk, tms570ls3137_hdk_intram,
    106     tms570ls3137_hdk_sdram,
    107     tms570ls3137_hdk_with_loader,
    108     xilinx_zynq_zc702, xilinx_zynq_zc706, xilinx_zynq_zedboard,
    109     xilinx_zynq_a9_qemu
    110 exclude-smp = arm1136jfs,
    111     arm1136js, arm7tdmi, arm920, armcortexa9, atsamv,
    112     beagleboardorig, beagleboardxm, beagleboneblack, beaglebonewhite,
    113     csb336, csb337, csb637,
    114     edb7312,
    115     kit637_v6,
    116     gumstix,
    117     lm3s3749, lm3s6965, lm3s6965_qemu, lm4f120,
    118     lpc1768_mbed, lpc1768_mbed_ahb_ram, lpc1768_mbed_ahb_ram_eth,
    119     lpc17xx_ea_ram, lpc17xx_ea_rom_int, lpc17xx_plx800_ram,
    120     lpc17xx_plx800_rom_int, lpc2362, lpc23xx_tli800, lpc24xx_ea,
    121     lpc24xx_ncs_ram, lpc24xx_ncs_rom_ext, lpc24xx_ncs_rom_int,
    122     lpc24xx_plx800_ram, lpc24xx_plx800_rom_int, lpc40xx_ea_ram,
    123     lpc40xx_ea_rom_int, lpc32xx_mzx, lpc32xx_mzx_stage_1,
    124     lpc32xx_mzx_stage_2, lpc32xx_phycore,
    125     raspberrypi, raspberrypi2,
    126     rtl22xx, rtl22xx_t,
    127     smdk2410,
    128     stm32f105rc, stm32f4,
    129     tms570ls3137_hdk, tms570ls3137_hdk_intram,
    130     tms570ls3137_hdk_sdram,
    131     tms570ls3137_hdk_with_loader
    132 exclude-network =
    133     altcycv_devkit, altcycv_devkit_smp,
    134     realview_pbx_a9_qemu, realview_pbx_a9_qemu_smp
    135 
    136 [i386]
    137 bsps = pc686
    138 exclude = smp
    139 bspopts_pc686 = BSP_PRINT_EXCEPTION_CONTEXT=1
    140 
    141 [moxie]
    142 bsps = moxiesim
    143 
    144 [sparc]
    145 bsps = erc32, leon2, leon3
    146 
    147 [powerpc]
    148 bsps =
    149 
    150 [epiphany]
    151 bsps = epiphany-sim
     97[architectures]
     98include = rtems-bsps-arm.ini,
     99          rtems-bsps-bfin.ini,
     100          rtems-bsps-epiphany.ini,
     101          rtems-bsps-i386.ini,
     102          rtems-bsps-lm32.ini,
     103          rtems-bsps-m32c.ini,
     104          rtems-bsps-m68k.ini,
     105          rtems-bsps-mips.ini,
     106          rtems-bsps-moxie.ini,
     107          rtems-bsps-or1k.ini,
     108          rtems-bsps-powerpc.ini,
     109          rtems-bsps-sh.ini,
     110          rtems-bsps-sparc.ini,
     111          rtems-bsps-sparc64.ini,
     112          rtems-bsps-v850.ini
    152113
    153114#
     
    168129no-tests = config:base
    169130#
    170 # The all, default is Yes and can be overriden in an architecture.
     131# The all build.
    171132#
    172133all = debug, profiling, smp, smp-debug,
     
    177138# The options for each varations.
    178139#
    179 debug             = config:base, config:tests, config:debug
    180 profiling         = config:base, config:tests, config:profiling
    181 smp               = config:base, config:tests, config:smp
    182 smp-debug         = config:base, config:tests, config:smp, config:debug
    183 posix             = config:base, config:tests, config:posix
    184 no-posix          = config:base, config:tests, config:no-posix
    185 posix-debug       = config:base, config:tests, config:posix, config:debug
    186 posix-profiling   = config:base, config:tests, config:posix, config:profiling
    187 network           = config:base, config:tests, config:network
    188 no-network        = config:base, config:tests, config:no-network
    189 network-debug     = config:base, config:tests, config:network, config:debug
    190 smp-network       = config:base, config:tests, config:smp, config:network
    191 smp-network-debug = config:base, config:tests, config:smp, config:network,
    192                     config:debug
     140debug             = config:base, config:debug
     141profiling         = config:base, config:profiling
     142smp               = config:base, config:smp
     143smp-debug         = config:base, config:smp, config:debug
     144posix             = config:base, config:posix
     145no-posix          = config:base, config:no-posix
     146posix-debug       = config:base, config:posix, config:debug
     147posix-profiling   = config:base, config:posix, config:profiling
     148network           = config:base, config:network
     149no-network        = config:base, config:no-network
     150network-debug     = config:base, config:network, config:debug
     151smp-network       = config:base, config:smp, config:network
     152smp-network-debug = config:base, config:smp, config:network, config:debug
    193153
    194154#
     
    219179network           = --enable-networking
    220180no-network        = --disable-networking
    221 
    222 #
    223 # Define how each profile is to be treated. Note, hardware vs simulator testing
    224 # is handled in the configuration, there is not specific test to determine
    225 # this.
    226 #
    227 [tier-1-profile]
    228 active = Yes
    229 build = Yes
    230 tests = Yes
    231 
    232 [tier-2-profile]
    233 active = Yes
    234 build = Yes
    235 tests = Yes
    236 
    237 [tier-3-profile]
    238 active = Yes
    239 build = Yes
    240 tests = No
    241 
    242 [tier-4-profile]
    243 active = No
    244 build = No
    245 tests = No
Note: See TracChangeset for help on using the changeset viewer.