Package qm :: Package test :: Package classes :: Module compilation_test :: Class CompilationTest
[hide private]
[frames] | no frames]

Class CompilationTest
source code

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

A CompilationTest compiles and optionally runs an executable. CompilationTest allows simple cross-testing. To run the executable on anything other than localhost, specify a Host descriptor by means of the context variable 'CompilationTest.target'.

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)
The name of the compiler executable is taken from the context variable 'CompilationTest.compiler_path'.
  _GetCompilationSteps(self, context)
Return the compilation steps for this test.
  _IsExecutionRequired(self)
Returns true if the generated executable should be run.
  _GetTarget(self, context)
Returns a target for the executable to be run on.
  _CheckOutput(self, context, result, prefix, output, diagnostics)
Check that the 'output' contains appropriate 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]
options  
ldflags  
source_files  
executable  
execute  
_argument_dictionary  
_argument_list  

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

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: compiler_test.CompilerTest.Run
(inherited documentation)

_GetCompiler(self, context)

source code 
The name of the compiler executable is taken from the context variable 'CompilationTest.compiler_path'.
Overrides: compiler_test.CompilerTest._GetCompiler

_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.
Overrides: compiler_test.CompilerTest._GetCompilationSteps
(inherited documentation)

_IsExecutionRequired(self)

source code 

Returns true if the generated executable should be run.

returns -- True if the generated executable should be run.
Overrides: compiler_test.CompilerTest._IsExecutionRequired
(inherited documentation)

_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.
Overrides: compiler_test.CompilerTest._GetTarget
(inherited documentation)

_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.
Overrides: compiler_test.CompilerTest._CheckOutput
(inherited documentation)

Class Variable Details [hide private]

options

Value:
[]                                                                     
      

ldflags

Value:
[]                                                                     
      

source_files

Value:
[]                                                                     
      

executable

Value:
''                                                                     
      

execute

Value:
'true'                                                                 
      

_argument_dictionary

Value:
{'executable': <<class 'qm.fields.TextField'> executable>,
 'execute': <<class 'qm.fields.BooleanField'> execute>,
 'ldflags': <<class 'qm.fields.SetField'> ldflags>,
 'options': <<class 'qm.fields.SetField'> options>,
 'prerequisites': <<class 'qm.fields.SetField'> prerequisites>,
 'resources': <<class 'qm.fields.SetField'> resources>,
 'source_files': <<class 'qm.fields.SetField'> source_files>,
 'target_group': <<class 'qm.test.test.TargetGroupField'> target_group\
...                                                                    
      

_argument_list

Value:
[<<class 'qm.fields.TextField'> executable>,
 <<class 'qm.fields.SetField'> prerequisites>,
 <<class 'qm.test.test.TargetGroupField'> target_group>,
 <<class 'qm.fields.BooleanField'> execute>,
 <<class 'qm.fields.SetField'> ldflags>,
 <<class 'qm.fields.SetField'> source_files>,
 <<class 'qm.fields.SetField'> options>,
 <<class 'qm.fields.SetField'> resources>]