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'.
source code
 
GetSubdirectories(self, directory)
Return the immediate subdirectories of 'directory'.
source code
 
GetIds(self, kind, directory='', scan_subdirs=1)
Return all IDs of the indicated 'kind' that begin with 'directory'.
source code
 
GetExtension(self, id)
Return the extension object named 'id'.
source code
 
_MakeTest(self, test_id, language) source code

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

Class Variables [hide private]
  srcdir = TextField(title= "Source Directory", description= "Th...
  excluded_subdirs = SetField(TextField(), default_value= ['QMTe...
  test_extensions = DictionaryField(TextField(), EnumerationFiel...
  _is_generic_database = True
True if this database implements 'GetExtension' as a primitive.

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

Properties [hide private]

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: object.__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)

Class Variable Details [hide private]

srcdir

Value:
TextField(title= "Source Directory", description= "The root of the tes\
t suite's source tree.")

excluded_subdirs

Value:
SetField(TextField(), default_value= ['QMTest', 'CVS', '.svn', 'build'\
])

test_extensions

Value:
DictionaryField(TextField(), EnumerationField(enumerals= ['c', 'cplusp\
lus']), default_value= {'.c': 'c', '.cpp': 'cplusplus', '.cxx': 'cplus\
plus', '.cc': 'cplusplus', '.C': 'cplusplus', '.f': 'fortran'})