Next: , Previous: , Up: Core Internal Procedures  


6.1.1.25 check_conditional_xfail Procedure

This procedure adds a conditional xfail, based on compiler options used to create a test case executable. If an include options is found in the compiler flags, and it’s the right architecture, it’ll trigger an XFAIL. Otherwise it’ll produce an ordinary FAIL. You can also specify flags to exclude. This makes a result be a FAIL, even if the included options are found. To set the conditional, set the variable compiler_conditional_xfail_data to the fields

"[message string] [targets list] [includes list] [excludes list]"

(descriptions below). This is the checked at pass/fail decision time, so there is no need to call the procedure yourself, unless you wish to know if it gets triggered. After a pass/fail, the variable is reset, so it doesn’t effect other tests. It returns 1 if the conditional is true, or 0 if the conditional is false.

check_conditional_xfail{message targets includes excludes}

message

This is the message to print with the normal test result.

targets

This is a string with the list targets to activate this conditional on.

includes

This is a list of sets of options to search for in the compiler options to activate this conditional. If the list of sets of options is empty or if any set of the options matches, then this conditional is true. (It may be useful to specify an empty list of include sets if the conditional is always true unless one of the exclude sets matches.)

excludes

This is a list of sets of options to search for in the compiler options to activate this conditional. If any set of the options matches, (regardless of whether any of the include sets match) then this conditional is de-activated.

Specifying the conditional xfail data

	  set compiler_conditional_xfail_data { \
	       "I sure wish I knew why this was hosed" \
               "sparc*-sun*-* *-pc-*-*" \
               {"-Wall -v" "-O3"} \
               {"-O1" "-Map"} \
          }

What this does is it matches only for these two targets if "-Wall -v" or "-O3" is set, but neither "-O1" or "-Map" is set. For a set to match, the options specified are searched for independently of each other, so a "-Wall -v" matches either "-Wall -v" or "-v -Wall". A space separates the options in the string. Glob-style regular expressions are also permitted.


Next: , Previous: , Up: Core Internal Procedures