Skip to content
  • Maciej W. Rozycki's avatar
    testsuite: Support filtering targets by TCL procedure in `run_dump_test' · 6d9dabbb
    Maciej W. Rozycki authored
    Implement a more complex way of selecting targets to include or exclude
    with `run_dump_test' cases, by extending the syntax for the `target',
    `not-target', `skip' and `not-skip' options (with the binutils and GAS
    test suites) and the `target', `alltargets' and `notarget' options (with
    the LD test suite) to also accept a name of a TCL procedure instead of a
    target triplet glob matching expression.  The result, 1 or 0, of the
    procedure determines whether the test is to be run or not.  This mimics
    and expands `dg-require-effective-target' from the GCC test suite.
    
    Names of TCL procedures are supplied in square brackets `[]' as with TCL
    procedure calls, observing that target triplet glob matching expressions
    do not normally start and end with matching square brackets both at a
    time.  Arguments for procedures are allowed if required.
    
    Having a way to specify a complex condition for a `run_dump_test' case
    to run has the advantage of keeping it local within the test case itself
    where tool options related to the check might be also present, removing
    the need to wrap `run_dump_test' calls into an `if' block whose only
    reason is to do a feature check, and ultimately lets one have the test
    reported as UNSUPPORTED automagically if required (not currently
    supported by the `run_dump_test' options used for LD).
    
    	binutils/
    	* testsuite/lib/binutils-common.exp (match_target): New procedure.
    	* testsuite/lib/utils-lib.exp (run_dump_test): Use it in place
    	of `istarget' for matching with `target', `not-target', `skip'
    	and `not-skip' options.
    
    	gas/
    	* testsuite/lib/gas-defs.exp (run_dump_test): Use `match_target'
    	in place of `istarget' for matching with `target', `not-target',
    	`skip' and `not-skip' options.
    
    	ld/
    	* testsuite/lib/ld-lib.exp (run_dump_test): Use `match_target'
    	in place of `istarget' for matching with `target', `alltargets'
    	and `notarget' options.
    6d9dabbb
To find the state of this project's repository at the time of any of these versions, check out the tags.