2.1. Setting Up

A test database is a directory that QMTest uses to store tests. If you want to create a new, empty test database from scratch, you use the qmtest create-tdb command, but for this tutorial, you should use the sample test database provided with QMTest. Since you'll modify the test database later in the tutorial, start by making a copy of it. Copy the entire test database directory tree to another location. If you've installed QMTest in the default location you can make a copy of the sample database by running this command on a UNIX system:


     > cp -r /usr/qm/tutorial/test/tdb tdb
    
On a Windows system, use this command at a DOS [1] prompt:

     > xcopy c:\Python23\qm\tutorial\test\tdb tdb\ /s
    
The exact paths to use depend on exactly how you have built and installed QMTest. The paths above are correct for the binary RPM and Windows packages distributed by CodeSourcery. If you build from the QMTest source distribution, the tutorial may be in another location, such as /usr/local/share/qm.

Then, enter the new directory you have created. On both UNIX and Windows systems, you can do this with this command:


     > cd tdb
    

Make sure that QMTest is in your PATH so that the operating system can find it. On UNIX, you can use this command:


     > PATH=/usr/bin:${PATH}; export PATH
    
in the Bourne shell. In the C shell, use:

     > setenv PATH /usr/bin:${PATH}
    
On Windows, use:

     > PATH C:\Python23\Scripts;%PATH%
    
If you are not using Python 2.3, replace C:\Python23 with the directory containing your Python installation.

In order to avoid having to retype these commands every time you want to use QMTest, you can set up your system so that these commands are executed automatically when you log in. Consult your system's manuals to find out how to do this.

On Windows, every command in this manual that begins with qmtest should be read as if it starts with qmtest.py. For example, if this tutorial instructs you to type:


     > qmtest run
    
you should instead type:

     > qmtest.py run
    
on a Windows system.

Notes

[1]

Under Windows, you must use the standard Windows command shell (DOS) to run QMTest; alternative shells (such as Cygwin) will not work with QMTest.