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
, 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).
Once you use setup_xfail
, the fail
and pass
procedures produce the messages `XFAIL' and `XPASS'
respectively, allowing you to distinguish expected failures (and
unexpected success!) from other test outcomes.
Warning: you must clear the expected failure after using
setup_xfail
in a test case. Any call to pass
or
fail
clears the expected failure implicitly; if the test has some
other outcome, e.g. an error, you can call clear_xfail
to clear
the expected failure explicitly. Otherwise, the expected-failure
declaration applies to whatever test runs next, leading to surprising
results.
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
.
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 "-".
Go to the first, previous, next, last section, table of contents.