5. Test Databases

5.1. XMLDatabase

The XMLDatabase stores its content as a directory hierarchy containing XML files. It is the default test database used by QMTest. Each QMTest subdirectory is represented by a subdirectory in the filesystem. A test, suite, or resource is represented by an XML file. These files have file extensions .qmt, .qms, and .qma, respectively.

Expert QMTest users may modify the contents of the test database directly by editing these files. However, it is the user's responsibility to ensure the integrity and validity of the XML contents of each file. For example, file and directory names should contain only characters allowed in identifiers (lower-case letters, digits, hyphens, and underscores); a period should only be used before a file extension, such as .qmt. Also, the files and directories in a test database should not be modified directly while QMTest is running with that test database.

5.2. CompilationTestDatabase

The CompilationTestDatabase associates source files with CompilationTest instances. The mapping uses file extensions to determine the programming language, and thus, what compiler and compilation flags to use. To create a new test, simply add a source file with an appropriate file extension to the test database.

All tests use the CompilerTable resource, and therefor require the appropriate context variables to be provided.

Additionally, more compiler options can be added per test id or even subdirectory id. Given the following context file:

CompilerTable.languages=c
CompilerTable.c_kind=GCC
CompilerTable.c_path=gcc
CompilerTable.c_options=-O2
a.b.c_options=-I /a/b/common
a.b.c.c_options=-I /a/b/c
     

a test a/b/c/test.c will be compiled with gcc -O2 -I /a/b/common -I /a/b/c while a test a/b/d/test.c will be compiled with gcc -O2 -I /a/b/common.

The CompilationTestDatabase takes the following parameters.

srcdir (text field)

The root of the test suite's source tree.

excluded_subdirs (set field)

A set of directory names not to be parsed as subdirectories.

test_extensions (dictionary field)

The mapping from file extensions to programming languages.