DejaGnu

The GNU Testing Framework

Rob Savoye

Free Software Foundation

Table of Contents
Abstract
1. Overview
What is DejaGnu ?
What's New In This Release
NT Support
Design Goals
A POSIX conforming test framework
2. Running Tests
Make check
Runtest
Output States
Invoking Runtest
Common Options
The files DejaGnu produces.
Summary File
Log File
Debug Log File
3. Customizing DejaGnu
Local Config File
Global Config File
Board Config File
Remote Host Testing
Config File Values
Command Line Option Variables
Personal Config File
4. Extending DejaGnu
Adding A New Test Suite
Adding A New Tool
Adding A New Target
Adding A New Board
Board Config File Values
Writing A Test Case
Debugging A Test Case
Adding A Test Case To A Test Suite.
Hints On Writing A Test Case
Special variables used by test cases.
5. Unit Testing
What Is Unit Testing ?
The dejagnu.h Header File
6. Reference
Obtaining DejaGnu
Installation
Configuring DejaGnu
Installing DejaGnu
Builtin Procedures
Core Internal Procedures
Procedures For Remote Communication
Procedures For Using Utilities to Connect
Procedures For Target Boards
Target Database Procedures
Platform Dependant Procedures
Utility Procedures
Libgloss, A Free BSP
Procedures for debugging your Tcl code.
File Map
7. Unit Testing API
C Unit Testing API
Pass Function
Fail Function
Untested Function
Unresolved Function
Totals Function
C++ Unit Testing API
Pass Method
Fail Method
Untested Method
Unresolved Method
Totals Method
List of Tables
3-1. Tcl Variables For Command Line Options
4-1. Common Board Info Fields
4-2. Board Info Fields For GCC & GDB
List of Examples
2-1. Here is a short sample summary log
2-2. Here is a brief example showing a detailed log for G++ tests
2-3. The log messages begin with a message of the form
2-4. Here is an excerpt from the debugging log for a GDB test:
3-1. The first section starts with
3-2. The first section ends with this line
3-3. Local Config File
3-4. Global Config file
3-5. Board Config File
3-6. Remote host setup
3-7. Add The Board Directory
3-8. Setup Cross Remote Testing
3-9. Setup Native Remote Testing
3-10. Run Test Remotely
3-11. Run a Test Remotely
3-12. Personal Config File
4-1. Sample Makefile.in Fragment
4-2. Simple Batch Program Tool Init File
4-3. Simple Interactive Program Tool Init File
4-4. Testing A New Tool Config
4-5. Example Test Case Run
4-6. Testing a New Board Config File
4-7. Example Board Config File
6-1. Specifying the conditional xfail data