Changeset 803b63d in rtems-tools for tester


Ignore:
Timestamp:
Apr 27, 2014, 5:35:01 PM (5 years ago)
Author:
Ben Gras <beng@…>
Branches:
4.10, 4.11, master
Children:
a28e562
Parents:
47d652c
git-author:
Ben Gras <beng@…> (04/27/14 17:35:01)
git-committer:
Chris Johns <chrisj@…> (05/09/14 11:39:01)
Message:

add --filter to specify the set of selected tests.

. parameter is a glob
. default is *.exe as it was
. it is a convenient way to select a particular test to run over and

over again while debugging it, without laboriously manipulating the
.exe's that are present (i.e. moving/deleting them)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/rt/test.py

    r47d652c r803b63d  
    4545import report
    4646import version
     47import fnmatch
    4748
    4849def stacktraces():
     
    120121            raise self.result[0], self.result[1], self.result[2]
    121122
    122 def find_executables(paths):
     123def find_executables(paths, glob):
    123124    executables = []
    124125    for p in paths:
     
    128129            for root, dirs, files in os.walk(p, followlinks = True):
    129130                for f in files:
    130                     if f.lower().endswith('.exe'):
     131                    if fnmatch.fnmatch(f.lower(), glob):
    131132                        executables += [path.join(root, f)]
    132133    return sorted(executables)
     
    179180    stdtty = console.save()
    180181    opts = None
     182    default_exefilter = '*.exe'
    181183    try:
    182184        optargs = { '--rtems-tools': 'The path to the RTEMS tools',
     
    185187                    '--list-bsps':   'List the supported BSPs',
    186188                    '--debug-trace': 'Debug trace based on specific flags',
     189                    '--filter':      'Glob that executables must match to run (default: ' +
     190                              default_exefilter + ')',
    187191                    '--stacktrace':  'Dump a stack trace on a user termination (^C)' }
    188192        opts = options.load(sys.argv,
     
    192196        if opts.find_arg('--list-bsps'):
    193197            list_bsps(opts)
     198        exe_filter = opts.find_arg('--filter')
     199        if exe_filter:
     200            exe_filter = exe_filter[1]
     201        else:
     202            exe_filter = default_exefilter
    194203        opts.log_info()
    195204        debug_trace = opts.find_arg('--debug-trace')
     
    226235        else:
    227236            report_mode = 'failures'
    228         executables = find_executables(opts.params())
     237        executables = find_executables(opts.params(), exe_filter)
    229238        if len(executables) == 0:
    230239            raise error.general('no executbles supplied')
Note: See TracChangeset for help on using the changeset viewer.