A DGTest is a test using the DejaGNU dg driver.
This test class emulates the dg.exp source file in the DejaGNU
distribution.
Methods
|
|
|
|
_DGbogus
|
_DGbogus (
self,
line_num,
args,
context,
)
Emulate the dg-bogus command.
-
line_num
- The number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|
_DGdo
|
_DGdo (
self,
line_num,
args,
context,
)
Emulate the dg-do command.
-
line_num
- The line number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|
_DGerror
|
_DGerror (
self,
line_num,
args,
context,
)
Emulate the dg-error command.
-
line_num
- The number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|
_DGexcess_errors
|
_DGexcess_errors (
self,
line_num,
args,
context,
)
Emulate the dg-excess-errors command.
-
line_num
- The line number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|
_DGfinal
|
_DGfinal (
self,
line_num,
args,
context,
)
Emulate the dg-final command.
-
line_num
- The line number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|
_DGoptions
|
_DGoptions (
self,
line_num,
args,
context,
)
Emulate the dg-options command.
-
line_num
- The line number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|
_DGwarning
|
_DGwarning (
self,
line_num,
args,
context,
)
Emulate the dg-warning command.
-
line_num
- The number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|
_ExecuteFinalCommand
|
_ExecuteFinalCommand (
self,
command,
args,
context,
result,
)
Run a command specified with dg-final .
-
command
- A string giving the name of the command.
-
args
- A list of strings giving the arguments (if any) to
that command.
-
context
- The
Context in which this test is running.
-
result
- The
Result of this test.
Exceptions
|
|
self.DGException, 'dg-final command \"%s\" is not implemented' % command
|
|
|
_ParseTargetSelector
|
_ParseTargetSelector (
self,
selector,
context,
)
Parse the target selector .
-
selector
- A target selector.
-
context
- The
Context in which the test is running.
- returns
- For a
target selector, S if this test should be
run, or N if it should not. For an xfail selector, F if
the test is expected to fail; P if if not.
This function emulates dg-process-target.
|
|
_PruneOutput
|
_PruneOutput ( self, output )
Remove unintersting messages from output .
-
output
- A string giving the output from the tool being
tested.
- returns
- A modified version of
output . This modified
version does not contain tool output messages that are
irrelevant for testing purposes.
|
|
_RunDGExecutePortion
|
_RunDGExecutePortion (
self,
file,
context,
result,
)
Perform the executable-running portions of a DG test.
If this is a "run" test, runs the executable generated by the
tool and checks its output.
|
|
_RunDGTest
|
_RunDGTest (
self,
tool_flags,
default_options,
context,
result,
path=None,
default_kind=None,
keep_output=0,
)
Run a dg test.
-
tool_flags
- A list of strings giving a set of options to be
provided to the tool being tested.
-
default_options
- A list of strings giving a default set of
options to be provided to the tool being tested. These options
can be overridden by an embedded
dg-options command in the
test itself.
-
context
- The
Context in which this test is running.
-
result
- The
Result of the test execution.
-
path
- The path to the test file. If
None , the main test
file path is used.
-
default_kind
- The kind of test to perform. If this value
is
None , then self._default_kind is used.
-
keep_output
- True if the output file should be retained
after the test is complete. Otherwise, it is removed.
This function emulates dg-test .
|
|
_RunDGToolPortion
|
_RunDGToolPortion (
self,
path,
tool_flags,
context,
result,
)
Perform the tool-running portions of a DG test.
Calls _RunTool and processes its output.
- returns
- The filename of the generated file.
|
|
_RunTool
|
_RunTool (
self,
path,
kind,
options,
context,
result,
)
Run the tool being tested.
-
path
- The path to the test file.
-
kind
- The kind of test to perform.
-
options
- A list of strings giving command-line options to
provide to the tool.
-
context
- The
Context for the test execution.
-
result
- The QMTest
Result for the test.
- returns
- A pair
(output, file) where output consists of
any messages produced by the compiler, and file is the name
of the file produced by the compilation, if any.
|
|
__ExpectDiagnostic
|
__ExpectDiagnostic (
self,
kind,
line_num,
args,
context,
)
Register an expected diagnostic.
-
kind
- The kind of diagnostic expected.
-
line_num
- The number at which the command was found.
-
args
- The arguments to the command, as a list of
strings.
-
context
- The
Context in which the test is running.
|
|