Package qm :: Package test :: Package classes :: Module compiler_test :: Class CompilerTest
[hide private]
[frames] | no frames]

Class CompilerTest
source code

         object --+            
                  |            
extension.Extension --+        
                      |        
      runnable.Runnable --+    
                          |    
                  test.Test --+
                              |
               CompilerBase --+
                              |
                             CompilerTest
Known Subclasses:
compilation_test.CompilationTest

A 'CompilerTest' tests a compiler.

Nested Classes [hide private]

Inherited from test.Test: OutcomeField, TestField

Inherited from runnable.Runnable: ResourceField

Inherited from extension.Extension: Type, __metaclass__


Instance Methods [hide private]
  Run(self, context, result)
Run the test.
  _GetCompiler(self, context)
Return the 'Compiler' to use.
  _GetCompilationSteps(self, context)
Return the compilation steps for this test.
  _GetTarget(self, context)
Returns a target for the executable to be run on.
  _IsExecutionRequired(self)
Returns true if the generated executable should be run.
  _GetExecutableArguments(self)
Returns the arguments to the generated executable.
  _MustExecutableExitSuccessfully(self)
Returns true if the executable must exit with code zero.
  _GetAnnotationPrefix(self)
Return the prefix to use for result annotations.
  _GetLibraryDirectories(self, context)
Returns the directories to search for libraries.
  _RunExecutable(self, path, context, result)
Run an executable generated by the compiler.
  _CheckOutput(self, context, result, prefix, output, diagnostics)
Check that the 'output' contains appropriate diagnostics.
  _CheckExecutableOutput(self, result, output)
Checks the output from the generated executable.
  _IsDiagnosticExpected(self, emitted, expected)
Returns true if 'emitted' matches 'expected'.
  _DiagnosticsToString(self, result, annotation, diagnostics)
Return a string representing the 'diagnostics'.

Inherited from test.Test: GetTargetGroup

Inherited from runnable.Runnable: GetAttachments, GetDatabase, GetId, __init__

Inherited from extension.Extension: GetClassName, GetExplicitArguments, MakeDomDocument, MakeDomElement, Write, __getattr__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]
_ignored_diagnostic_regexps A sequence of regular expressions matching diagnostics to ignore.

Inherited from test.Test: PREREQUISITES_FIELD_ID, arguments, kind, prerequisites, target_group

Inherited from test.Test (private): _argument_dictionary, _argument_list

Inherited from runnable.Runnable: EXTRA_DATABASE, EXTRA_ID, RESOURCE_FIELD_ID, resources

Inherited from object: __class__


Method Details [hide private]

Run(self, context, result)

source code 

Run the test.

'context' -- A 'Context' giving run-time parameters to the test.

'result' -- A 'Result' object. The outcome will be 'Result.PASS' when this method is called. The 'result' may be modified by this method to indicate outcomes other than 'Result.PASS' or to add annotations.
Overrides: test.Test.Run

_GetCompiler(self, context)

source code 

Return the 'Compiler' to use.

'context' -- The 'Context' in which this test is being executed.

_GetCompilationSteps(self, context)

source code 

Return the compilation steps for this test.

'context' -- The 'Context' in which this test is being executed.

returns -- A sequence of 'CompilationStep' objects.

_GetTarget(self, context)

source code 

Returns a target for the executable to be run on.

'context' -- The Context in which this test is being executed.

returns -- A Host to run the executable on.

_IsExecutionRequired(self)

source code 

Returns true if the generated executable should be run.

returns -- True if the generated executable should be run.

_GetExecutableArguments(self)

source code 

Returns the arguments to the generated executable.

returns -- A list of strings, to be passed as argumensts to the generated executable.

_MustExecutableExitSuccessfully(self)

source code 

Returns true if the executable must exit with code zero.

returns -- True if the generated executable (if any) must exit with code zero. Note that the executable will not be run at all (and so the return value of this function will be ignored) if '_IsExecutionRequired' does not return true.

_GetAnnotationPrefix(self)

source code 

Return the prefix to use for result annotations.

returns -- The prefix to use for result annotations.

_GetLibraryDirectories(self, context)

source code 

Returns the directories to search for libraries.

'context' -- A 'Context' giving run-time parameters to the test.

returns -- A sequence of strings giving the paths to the directories to search for libraries.

_RunExecutable(self, path, context, result)

source code 

Run an executable generated by the compiler.

'path' -- The path to the generated executable.

'context' -- A 'Context' giving run-time parameters to the test.

'result' -- A 'Result' object. The outcome will be 'Result.PASS' when this method is called. The 'result' may be modified by this method to indicate outcomes other than 'Result.PASS' or to add annotations.

_CheckOutput(self, context, result, prefix, output, diagnostics)

source code 

Check that the 'output' contains appropriate diagnostics.

'context' -- The 'Context' for the test that is being executed.

'result' -- The 'Result' of the test.

'prefix' -- A string giving the prefix for any annotations to be added to the 'result'.

'output' -- A string giving the output of the compiler.

'diagnostics' -- The diagnostics that are expected for the compilation.

returns -- True if there were no errors so severe as to prevent execution of the test.

_CheckExecutableOutput(self, result, output)

source code 

Checks the output from the generated executable.

'result' -- The 'Result' object for this test.

'output' -- The output generated by the executable.

If the output is unsatisfactory, 'result' is modified appropriately.

_IsDiagnosticExpected(self, emitted, expected)

source code 

Returns true if 'emitted' matches 'expected'.

'emitted' -- A 'Diagnostic emitted by the compiler.

'expected' -- A 'Diagnostic' indicating an expectation about a diagnostic to be emitted by the compiler.

returns -- True if the 'emitted' was expected by the 'expected'.

_DiagnosticsToString(self, result, annotation, diagnostics)

source code 

Return a string representing the 'diagnostics'.

'diagnostics' -- A sequence of 'Diagnostic' instances.

returns -- A string representing the 'Diagnostic's, with one diagnostic message per line.

Class Variable Details [hide private]

_ignored_diagnostic_regexps

A sequence of regular expressions matching diagnostics to ignore.
Value:
()