The GNU Testing Framework

Revision History
Revision 0.6.22002-07-16Revised by: rob
Add new tutorial as a new sect1.
Revision 0.6.12001-02-16Revised by: rob
Add info on the new dejagnu.h file.
Revision 0.62001-02-16Revised by: rob
Updated for new release.
Revision 0.52000-01-24Revised by: rob
Initial version after conversion to DocBook.

Table of Contents
1. Abstract
2. Overview
2.1. What is DejaGnu ?
2.2. New In This Release
2.2.1. Windows Support
2.3. Design Goals
2.4. A POSIX conforming test framework
3. Getting DejaGnu up and running
3.1. Test your installation
3.1.1. Windows
3.1.2. Getting the source code for the calc example
3.2. Create a minimal project, e.g. calc
3.2.1. A simple project without the GNU autotools
3.2.2. Using autoconf/autoheader/automake
3.3. Our first automated tests
3.3.1. Running the test for the calc example
3.3.2. The various config files or how to avoid warnings
3.3.3. When trouble strikes
3.3.4. Testing "Hello world" locally
3.4. A first remote test
3.4.1. Setup telnet to your own host
3.4.2. A test case for login via telnet
3.4.3. Remote testing "Hello world"
3.4.4. Transferring files from/to the target
3.4.5. Preparing for crosscompilation
3.4.6. Remote testing of calc
3.4.7. Using Windows as host and vxWorks as target
4. Running Tests
4.1. Make check
4.2. Runtest
4.2.1. Output States
4.2.2. Invoking Runtest
4.2.3. Common Options
4.3. The files DejaGnu produces.
4.3.1. Summary File
4.3.2. Log File
4.3.3. Debug Log File
5. Customizing DejaGnu
5.1. Local Config File
5.2. Global Config File
5.3. Board Config File
5.4. Remote Host Testing
5.5. Config File Values
5.5.1. Command Line Option Variables
5.5.2. Personal Config File
6. Extending DejaGnu
6.1. Adding A New Testsuite
6.2. Adding A New Tool
6.3. Adding A New Target
6.4. Adding A New Board
6.5. Board Config File Values
6.6. Writing A Test Case
6.7. Debugging A Test Case
6.8. Adding A Test Case To A Testsuite.
6.9. Hints On Writing A Test Case
6.10. Special variables used by test cases.
7. Unit Testing
7.1. What Is Unit Testing ?
7.2. The dejagnu.h Header File
8. Reference
8.1. Obtaining DejaGnu
8.2. Installation
8.2.1. Configuring DejaGnu
8.2.2. Installing DejaGnu
8.3. Builtin Procedures
8.3.1. Core Internal Procedures
8.3.2. Procedures For Remote Communication
8.3.3. Procedures For Using Utilities to Connect
8.3.4. Procedures For Target Boards
8.3.5. Target Database Procedures
8.3.6. Platform Dependent Procedures
8.3.7. Utility Procedures
8.3.8. Libgloss, A Free BSP
8.3.9. Procedures for debugging your Tcl code.
8.4. File Map
9. Unit Testing API
9.1. C Unit Testing API
9.1.1. Pass Function
9.1.2. Fail Function
9.1.3. Untested Function
9.1.4. Unresolved Function
9.1.5. Totals Function
9.2. C++ Unit Testing API
9.2.1. Pass Method
9.2.2. Fail Method
9.2.3. Untested Method
9.2.4. Unresolved Method
9.2.5. Totals Method

1. Abstract

This document describes the functionality of DejaGnu, the testing framework of the GNU project. DejaGnu is written in Expect, which uses Tcl as a command language. Expect acts as a very programmable shell. As with other Unix command shells, you can run any program, but once the program is started, your test script has programmable control over its input and output. This does not just apply to the programs under test; expect can also run any auxiliary program, such as diff or sh, with full control over its input and output.

DejaGnu itself is merely a framework for the creation of testsuites. Testsuites are distributed with each application.