DejaGnu
The GNU Testing Framework
Rob Savoye
Free Software Foundation
Copyright © 2002 Free Software Foundation, Inc.
Table of Contents
Abstract
1.
Overview
1.1.
What is DejaGnu ?
1.2.
What's New In This Release
1.2.1.
NT Support
1.3.
Design Goals
1.4.
A POSIX conforming test framework
2.
Getting DejaGnu up and running
2.1.
Test your installation
2.1.1.
Windows
2.1.2.
Getting the source code for the calc example
2.2.
Create a minimal project, e.g. calc
2.2.1.
A simple project without the GNU autotools
2.2.2.
Using autoconf/autoheader/automake
2.3.
Our first automated tests
2.3.1.
Running the test for the calc example
2.3.2.
The various config files or how to avoid warnings
2.3.3.
When trouble strikes
2.3.4.
Testing “Hello world” locally
2.4.
A first remote test
2.4.1.
Setup telnet to your own host
2.4.2.
A test case for login via telnet
2.4.3.
Remote testing “Hello world”
2.4.4.
Transferring files from/to the target
2.4.5.
Preparing for crosscompilation
2.4.6.
Remote testing of calc
2.4.7.
Using WindowsNT as host and vxWorks as target
3.
Running Tests
3.1.
Make check
3.2.
Runtest
3.2.1.
Output States
3.2.2.
Invoking Runtest
3.2.3.
Common Options
3.3.
The files DejaGnu produces.
3.3.1.
Summary File
3.3.2.
Log File
3.3.3.
Debug Log File
4.
Customizing DejaGnu
4.1.
Local Config File
4.2.
Global Config File
4.3.
Board Config File
4.4.
Remote Host Testing
4.5.
Config File Values
4.5.1.
Command Line Option Variables
4.5.2.
Personal Config File
5.
Extending DejaGnu
5.1.
Adding A New Test Suite
5.2.
Adding A New Tool
5.3.
Adding A New Target
5.4.
Adding A New Board
5.5.
Board Config File Values
5.6.
Writing A Test Case
5.7.
Debugging A Test Case
5.8.
Adding A Test Case To A Test Suite.
5.9.
Hints On Writing A Test Case
5.10.
Special variables used by test cases.
6.
Unit Testing
6.1.
What Is Unit Testing ?
6.2.
The dejagnu.h Header File
7.
Reference
7.1.
Obtaining DejaGnu
7.2.
Installation
7.2.1.
Configuring DejaGnu
7.2.2.
Installing DejaGnu
7.3.
Builtin Procedures
7.3.1.
Core Internal Procedures
7.3.2.
Procedures For Remote Communication
7.3.3.
Procedures For Using Utilities to Connect
7.3.4.
Procedures For Target Boards
7.3.5.
Target Database Procedures
7.3.6.
Platform Dependant Procedures
7.3.7.
Utility Procedures
7.3.8.
Libgloss, A Free BSP
7.3.9.
Procedures for debugging your Tcl code.
7.4.
File Map
8.
Unit Testing API
8.1.
C Unit Testing API
8.1.1.
Pass Function
8.1.2.
Fail Function
8.1.3.
Untested Function
8.1.4.
Unresolved Function
8.1.5.
Totals Function
8.2.
C++ Unit Testing API
8.2.1.
Pass Method
8.2.2.
Fail Method
8.2.3.
Untested Method
8.2.4.
Unresolved Method
8.2.5.
Totals Method
List of Tables
4-1.
Tcl Variables For Command Line Options
5-1.
Common Board Info Fields
5-2.
Board Info Fields For GCC & GDB
List of Examples
2-1.
Runtest output in a empty directory
2-2.
Sample output of automake with missing files
2-3.
Sample output of configure
2-4.
Sample output building calc
2-5.
Creating the calc program using the GNU autotools
2-6.
Sample output generating a site.exp
2-7.
Sample output of runtest in a configured directory
2-8.
Sample output of runtest with the usual configuration files
2-9.
Displaying details about runtest execution
2-10.
A first (local) test case
2-11.
Sample log of a telnet login to localhost
2-12.
Defining a remote target board
2-13.
DejaGnu script for logging in into a remote target
2-14.
A first (local) remote "Hello world" test
2-15.
Board definition for a remote target
2-16.
Test script to transfer a file to a remote target
2-17.
Defining a board to use FTP as file transport
2-18.
Using autotools for cross development
3-1.
Here is a short sample summary log
3-2.
Here is a brief example showing a detailed log for
G++
tests
3-3.
The log messages begin with a message of the form
3-4.
Here is an excerpt from the debugging log for a
GDB
test:
4-1.
The first section starts with
4-2.
The first section ends with this line
4-3.
Local Config File
4-4.
Global Config file
4-5.
Board Config File
4-6.
Remote host setup
4-7.
Add The Board Directory
4-8.
Setup Cross Remote Testing
4-9.
Setup Native Remote Testing
4-10.
Run Test Remotely
4-11.
Run a Test Remotely
4-12.
Personal Config File
5-1.
Sample Makefile.in Fragment
5-2.
Simple Batch Program Tool Init File
5-3.
Simple Interactive Program Tool Init File
5-4.
Testing A New Tool Config
5-5.
Example Test Case Run
5-6.
Testing a New Board Config File
5-7.
Example Board Config File
7-1.
Specifying the conditional xfail data
Next
Abstract