DejaGnu is a
software framework
In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard ...
for
testing other programs. It has a main
script
Script may refer to:
Writing systems
* Script, a distinctive writing system, based on a repertoire of specific elements or symbols, or that repertoire
* Script (styles of handwriting)
** Script typeface, a typeface with characteristics of ha ...
called ''runtest'' that goes through a
directory
Directory may refer to:
* Directory (computing), or folder, a file system structure in which to store computer files
* Directory (OpenVMS command)
* Directory service, a software application for organizing information about a computer network' ...
looking at
configuration file
In computing, configuration files (commonly known simply as config files) are files used to configure the parameters and initial settings for some computer programs. They are used for user applications, server processes and operating system ...
s and then runs some tests with given criteria. The purpose of the DejaGnu package is to provide a single
front end for all tests. It is a part of the
GNU Project
The GNU Project () is a free software, mass collaboration project announced by Richard Stallman on September 27, 1983. Its goal is to give computer users freedom and control in their use of their computers and Computer hardware, computing devi ...
and is licensed under the
GPL. It is based on
Expect
Expect is an extension to the Tcl scripting language written by Don Libes. The program automates interactions with programs that expose a text terminal interface. Expect, originally written in 1990 for the Unix platform, has since become avai ...
, which is in turn based on
Tcl. The current maintainers are
Rob Savoye and Ben Elliston.
Testing
DejaGnu has a very strong history in testing due to its
Tcl base. Tcl is used extensively by companies such as
Oracle
An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination.
Description
The wor ...
and
Sybase
Sybase, Inc. was an enterprise software and services company. The company produced software to manage and analyze information in relational databases, with facilities located in California and Massachusetts. Sybase was acquired by SAP in 2010; ...
to test their products. DejaGnu allows this work to be much more structured.
The tests can be grouped according to the ''tool'' they are testing. The test is run by merely calling in the root project directory.
runtest --tool program_to_test
This will look in the directory for any folders starting with and will run all .exp files in that folder.
Embedded design
One field for which DejaGnu is particularly well suited is that of
embedded system design
Embedded or embedding (alternatively imbedded or imbedding) may refer to:
Science
* Embedding, in mathematics, one instance of some mathematical object contained within another instance
** Graph embedding
* Embedded generation, a distributed ...
. It allows for testing to be done remotely on development boards; separate initialization files can be created for each
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
and board. This mainly focuses on embedded targets and remote hosts. DejaGnu is thus popular with many GNU projects, at universities, and for private companies.
Files
Essential Files
*
** Each directory in testsuite should contain tests for a specific ''tool''. In this example, the tool being tested is the
Apache webserver.
*** This will be the file containing tests, which in this fictional case might change configuration options, and then connect to the network and check to make sure the changes have taken effect.
**
***
**
*** This file will be run as a ''tool init'' file for the tool called ''toolname''.
Other Files
* This file is a directory specific configuration file for . Options can be placed in this file rather than retyped on each invocation; these options can include any variable passed as a command line argument.
set tool Apache #run tests on Apache
set srcdir ./testsuite #look here for test files
set outdir ./logs #save the logs in a separate directory
set all 1 #show results from all tests (rather than just ones with errors)
* This is a personal configuration file, which should be located in the user's
home directory
A home directory is a file system directory on a multi-user operating system containing files for a given user of the system. The specifics of the home directory (such as its name and location) are defined by the operating system involved; for ...
()
* This is the first configuration file loaded. It can be named anything but must be pointed to by the $DEJAGNU
environment variable
An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP env ...
(set when your terminal loads).
References
{{reflist
External links
DejaGnu Homepage(dead link : obsolete since https://www.gnu.org/software/dejagnu/manual/index.html exists ?)
DejaGnu Bug Archives
Software testing tools
Scripting languages
Free software programmed in Tcl
GNU Project software