Getting Started

TextTest can be used either from the command line, or via a Graphical User Interface (GUI). The command line interface is mostly used for running the tests unattended (for example on a Continuous Integration server), or for systems where no window manager is available. For day-to-day work creating and maintaing tests, the GUI makes a lot more functionality available.

First we’ll show you a minimal example using just the command line, and then a slightly larger example using the GUI.

A Minimal Example on the Command Line

For example, if you have an executable script myapp.sh:

# myapp.sh
echo "Hello World"

Create a config file config.myapp telling TextTest how to execute your program:

# config.myapp
executable:myapp.sh

Create a subfolder to be a test case, for example named “HelloWorld”, and create a file testsuite.myapp telling TextTest to look in it:

# testsuite.myapp
HelloWorld

Execute TextTest in the same folder as the config file:

texttest -con -d .

It will execute your test case, and it will fail. Hopefully it will fail for the right reason - that you have not defined a “Golden Master” file for your test case “HelloWorld”. TextTest should ask you if you want to save the output. If you answer Yes, then it will save two new files in your HelloWorld folder - stdout.myapp and stderr.myapp. These files contain the output you just got from your script when you executed it, on standard output and standard error respectively.

If your test is failing for some other reason and you can’t work out what’s going on, please contact us via the TextTest mailing list. We are in the process of compiling a Frequently Asked Questions page.

Using the TextTest GUI

Start TextTest with the argument --new to tell it you want to build a test suite for an application:

texttest --new

This will present you with a dialog where you can fill in details of the application you want to test.