Package qm :: Package test :: Package classes :: Module compilation_test_database :: Class CompilationTestDatabase
[hide private]
[frames] | no frames]

Class CompilationTestDatabase
source code

         object --+        
                  |        
extension.Extension --+    
                      |    
      database.Database --+
                          |
                         CompilationTestDatabase

A 'CompilationTestDatabase' test database maps source code files to compilation tests.

Nested Classes [hide private]

Inherited from extension.Extension: Type, __metaclass__


Instance Methods [hide private]
  __init__(self, path, arguments)
Construct a 'Database'.
  GetSubdirectories(self, directory)
Return the immediate subdirectories of 'directory'.
  GetIds(self, kind, directory='', scan_subdirs=1)
Return all IDs of the indicated 'kind' that begin with 'directory'.
  GetExtension(self, id)
Return the extension object named 'id'.
  _MakeTest(self, test_id, language)

Inherited from database.Database: ExpandIds, GetAttachmentStore, GetClassPaths, GetConfigurationDirectory, GetExtensions, GetItem, GetLabelComponents, GetPath, GetResource, GetResourceClassNames, GetResourceIds, GetSuite, GetSuiteIds, GetTest, GetTestClassNames, GetTestIds, HasResource, HasSuite, HasTest, IsModifiable, IsValidLabel, JoinLabels, RemoveExtension, SplitLabel, SplitLabelLeft, WriteExtension

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]
srcdir  
excluded_subdirs  
test_extensions  
_is_generic_database True if this database implements 'GetExtension' as a primitive.
_argument_dictionary  
_argument_list  

Inherited from database.Database: ITEM_KINDS, RESOURCE, SUITE, TEST, arguments, kind, label_class, modifiable

Inherited from database.Database (private): _item_exceptions

Inherited from object: __class__


Method Details [hide private]

__init__(self, path, arguments)
(Constructor)

source code 

Construct a 'Database'.

'path' -- A string containing the absolute path to the directory containing the database.

'arguments' -- A dictionary mapping attribute names to values. The use of this parameter is deprecated. Use keyword arguments instead.

Derived classes must call this method from their own '__init__' methods. Every derived class must have an '__init__' method that takes the path to the directory containing the database as its only argument. The path provided to the derived class '__init__' function will always be an absolute path.
Overrides: database.Database.__init__
(inherited documentation)

GetSubdirectories(self, directory)

source code 

Return the immediate subdirectories of 'directory'.

'directory' -- A label indicating a directory in the database.

returns -- A sequence of (relative) labels indictating the immediate subdirectories of 'directory'. For example, if "a.b" and "a.c" are directories in the database, this method will return "b" and "c" given "a" as 'directory'.

Derived classes may override this method.
Overrides: database.Database.GetSubdirectories
(inherited documentation)

GetIds(self, kind, directory='', scan_subdirs=1)

source code 

Return all IDs of the indicated 'kind' that begin with 'directory'.

'kind' -- One of the 'ITEM_KINDS'.

'directory' -- A label indicating the directory in which to begin the search.

'scan_subdirs' -- True if (and only if) subdirectories of 'directory' should be scanned.

returns -- A list of all items of the indicated 'kind' located within 'directory', as absolute labels.

Derived classes may override this method.
Overrides: database.Database.GetIds
(inherited documentation)

GetExtension(self, id)

source code 

Return the extension object named 'id'.

'id' -- The label for the extension.

returns -- The instance of 'Extension' with the indicated name, or 'None' if there is no such entity.

Database classes should override this method. For backwards compatibility, this base class implements this generic method in terms of the special-purpose methods 'GetTest()' and 'GetResource()'. Only if _is_generic_database is True are these implemented in terms of 'GetExtension()'.
Overrides: database.Database.GetExtension
(inherited documentation)

_MakeTest(self, test_id, language)

source code 

Class Variable Details [hide private]

srcdir

Value:
''                                                                     
      

excluded_subdirs

Value:
['QMTest', 'CVS', '.svn', 'build']                                     
      

test_extensions

Value:
{'.C': 'cplusplus',
 '.c': 'c',
 '.cc': 'cplusplus',
 '.cpp': 'cplusplus',
 '.cxx': 'cplusplus',
 '.f': 'fortran'}                                                      
      

_is_generic_database

True if this database implements 'GetExtension' as a primitive.

Databases should implement 'GetExtension' and then override '_is_generic_database', setting it to 'True'. However, legacy databases implemented 'GetTest', 'GetResource', and 'GetSuite' as primivites. These legacy databases should not override '_generic_database'.
Value:
True                                                                   
      

_argument_dictionary

Value:
{'excluded_subdirs': <<class 'qm.fields.SetField'> excluded_subdirs>,
 'label_class': <<class 'qm.fields.TextField'> label_class>,
 'modifiable': <<class 'qm.fields.BooleanField'> modifiable>,
 'srcdir': <<class 'qm.fields.TextField'> srcdir>,
 'test_extensions': <<class 'qm.fields.DictionaryField'> test_extensio\
ns>}                                                                   
      

_argument_list

Value:
[<<class 'qm.fields.TextField'> label_class>,
 <<class 'qm.fields.DictionaryField'> test_extensions>,
 <<class 'qm.fields.BooleanField'> modifiable>,
 <<class 'qm.fields.TextField'> srcdir>,
 <<class 'qm.fields.SetField'> excluded_subdirs>]