| www.delorie.com/gnu/docs/dejagnu/dejagnu_19.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
See section A POSIX conforming test framework, for more detailed explanations of the test outcomes (`FAIL', `PASS', `UNTESTED', `UNRESOLVED', `UNSUPPORTED').
perror "string number"
perror writes in the log files a message beginning with
`ERROR', appending the argument string. If the optional
number is supplied, then this is used to set the internal count of
errors to that value.
As a side effect, perror also changes the effect of the next
pass or fail command: the test outcome becomes
`UNRESOLVED', since an automatic `PASS' or `FAIL' cannot
be trusted after a severe error in the test framework. If the optional
numeric value is `0', then there are no further side effects to
calling this function, and the following test outcome doesn't become
`UNRESOLVED'. This can be used for errors with no known side
effects.
warning "string number"
warning writes in the log files a message beginning with
`WARNING', appending the argument string. Use warning
rather than error for cases (such as communication failure
to be followed by a retry) where the test case can recover from the
error. If the optional number is supplied, then this is used to
set the internal count of warnings to that value.
As a side effect, warning_threshold or more calls to
warning in a single test case also changes the effect of the next
pass or fail command: the test outcome becomes
`UNRESOLVED' since an automatic `PASS' or `FAIL' may not
be trustworthy after many warnings. If the optional numeric value is
`0', then there are no further side effects to calling this
function, and the following test outcome doesn't become
`UNRESOLVED'. This can be used for errors with no known side
effects.
note "string"
note writes in the log files a message beginning with
`NOTE', appending the argument string. Use note
sparingly. verbose should be used for most such messages,
but in cases where a message is needed in the log file regardless of
the verbosity level use note.
pass "string"
pass writes in the
log files a message beginning with `PASS'
(or XPASS/KPASS, if failure was expected),
appending the argument string.
fail "string"
fail writes in the
log files a message beginning with `FAIL' (or XFAIL, if
failure was expected), appending the argument string.
unresolved "string"
unresolved writes
in the log file a message beginning with `UNRESOLVED', appending
the argument string. This usually means the test did not execute
as expected, and a human being must go over results to determine if it
passed or failed (and to improve the test case).
untested "string"
untested writes in the log file a
message beginning with `UNTESTED', appending the argument
string. For example, you might use this in a dummy test whose
only role is to record that a test does not yet exist for some feature.
unsupported "string"
unsupported writes in the log file a
message beginning with `UNSUPPORTED', appending the argument
string.
get_warning_threshold
warning_threshold.
The default value is 3.
set_warning_threshold threshold
warning_threshold.
A value of 0 disables it: calls to warning will not turn
a `PASS' or `FAIL' into an `UNRESOLVED'.
transform "toolname"
runtest as
`m68k-vxworks-runtest', the result of ` transform "gcc" '
is `m68k-vxworks-gcc'.
ishost "host"
1;
otherwise the result is 0. host must be a full three-part
configure host name; in particular, you may not use the shorter
nicknames supported by configure (but you can use wildcard
characters, using shell syntax, to specify sets of names).
istarget "target"
1;
otherwise the result is 0. target must be a full
three-part configure target name; in particular, you may not use
the shorter nicknames supported by configure (but you can use
wildcard characters, using shell syntax, to specify sets of names). If it is
passed a NULL string, then it returns the name of the build
canonical configuration.
isbuild "host"
1;
otherwise the result is 0. host must be a full three-part
configure host name; in particular, you may not use the shorter
nicknames supported by configure (but you can use wildcard
characters, using shell syntax, to specify sets of names). If it is
passed a NULL string, then it returns the name of the build
canonical configuration.
item is3way "host"
Tests for a canadian cross. This is when the tests will be run on a
remotly hosted cross compiler. If it is a canadian cross, then the
result is 1; otherwise the result is 0.
isnative
1; otherwise it returns a 0.
load_lib "library-file"
runtest. If DejaGnu has been installed, it looks in a path
starting with the installed library directory. If you are running
DejaGnu directly from a source directory, without first running
`make install', this path defaults to the current directory. In
either case, it then looks in the current directory for a directory
called lib. If there are duplicate definitions, the last one
loaded takes precedence over the earlier ones.
setup_xfail "config [bugid]"
configure target name; in particular, you may not use
the shorter nicknames supported by configure (but you can use the
common shell wildcard characters to specify sets of names). The
bugid argument is optional, and used only in the logging file
output; use it as a link to a bug-tracking system such as GNATS
(see section `Overview' in Tracking Bugs With GNATS).
setup_kfail "config [bugid]"
configure target name; in particular, you may not use
the shorter nicknames supported by configure (but you can use the
common shell wildcard characters to specify sets of names). The
bugid argument is mandatory, and used only in the logging file
output; use it as a link to a bug-tracking system such as GNATS
(see section `Overview' in Tracking Bugs With GNATS).
Once you use setup_xfail or setup_kfail, the fail
and pass procedures produce the messages `XFAIL' or `KFAIL'
and `XPASS' or `KPASS' respectively, allowing you to distinguish
expected/known failures (and unexpected success!) from other test outcomes.
If a test is marked as both expected to fail and known to fail for a certain configuration, a `KFAIL' message will be generated. As `KFAIL' messages are expected to draw more attention than the `XFAIL' ones this will hopefuly ensure the test result is not overlooked.
Warning: you must clear the expected/known failure after using
setup_xfail or setup_kfail in a test case. Any call to
pass or fail clears the expectedknown failure implicitly;
if the test has some other outcome, e.g. an error, you can call
clear_xfail to clear the expected failure or clear_kfail
to clear the known failure explicitly. Otherwise, the expected-failure
declaration applies to whatever test runs next, leading to surprising
results.
check_conditional_xfail message targets includes excludes
This procedure adds a condition 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.
The parameters are:
message
targets
includes
excludes
returns:
1
0
An example of setting the variable would be:
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 independantly of each other, so a "-Wall -v" matches either "-Wall -v" or "-v -Wall". A space seperates the options in the string. Glob-style regular expressions are also permitted.
clear_xfail config
setup_xfail)
for a particular set of configurations. The config argument is a
list of configuration target names. It is only necessary to call
clear_xfail if a test case ends without calling either
pass or fail, after calling setup_xfail.
clear_kfail config
setup_kfail)
for a particular set of configurations. The config argument is a
list of configuration target names. It is only necessary to call
clear_kfail if a test case ends without calling either
pass or fail, after calling setup_kfail.
verbose [-log] [-n] [--] [--] "string" number
runtest command
line. It prints string if the value of the variable
verbose is higher than or equal to the optional number. The
default value for number is 1. Use the optional `-log' argument
to cause string to always be added to the log file, even if it won't
be printed. Use the optional `-n' argument to print string
without a trailing newline. Use the optional `--' argument if
string begins with "-". To log test results to a XML file use the
`-x' argument.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |