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

Inherited from compiler_test.CompilerTest (private): _CheckExecutableOutput, _DiagnosticsToString, _GetAnnotationPrefix, _GetEnvironment, _GetExecutableArguments, _GetLibraryDirectories, _IsDiagnosticExpected, _MustExecutableExitSuccessfully, _RunExecutable

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__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from compiler_test.CompilerBase (private): _GetDirectory, _GetObjectFileName, _MakeDirectory, _RemoveDirectory

Class Variables [hide private]
  options = SetField(TextField(description= """Test-specific opt...
  ldflags = SetField(TextField(description= """Test-specific lin...
  source_files = SetField(TextField(description= "Source files t...
  executable = TextField(description= "The name of the executabl...
  execute = BooleanField(default_value= True, description= "Whet...

Inherited from compiler_test.CompilerTest (private): _ignored_diagnostic_regexps

Inherited from test.Test: PREREQUISITES_FIELD_ID, arguments, kind

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

Properties [hide private]

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
(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:
SetField(TextField(description= """Test-specific options to pass to th\
e compiler."""))

ldflags

Value:
SetField(TextField(description= """Test-specific link flags to pass to\
 the compiler."""))

source_files

Value:
SetField(TextField(description= "Source files to be compiled."))

executable

Value:
TextField(description= "The name of the executable to be compiled.")

execute

Value:
BooleanField(default_value= True, description= "Whether or not to run \
the compiled executable.")