From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
GNU DejaGnu
Developer(s) GNU Project
Stable release 1.4.4. / 7 October 2007
Operating system Cross-platform
Platform GNU
Type Framework for testing
License GNU General Public License

DejaGnu is a framework for testing other programs. It has a main script called runtest that goes through a directory looking at configuration files 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 and as such is under the GPL. It is based on Expect, which is in turn based on Tcl. The current maintainers are Rob Savoye, and Ben Elliston.



DejaGnu has a very strong history in testing due to its Tcl base. Tcl is used extensively by companies such as Oracle and Sybase 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 runtest in the root project directory.

 runtest --tool program_to_test

This will look in the testsuite directory for any folders starting with program_to_test 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. It allows for testing to be done remotely on development boards; separate initialization files can be created for each operating system and board. This mainly focuses on embedded targets and remote hosts. DejaGNU is thus very popular with many GNU projects, at universities, and for private companies.


Essential Files

  • testsuite
    • Apache Each directory in testsuite should contain tests for a specific tool. In this example, the tool(program) being tested is Apache, the webserver.
      • Apache.test1.exp This will be the file containing some of your tests. In the fictional case of testing Apache, these tests might contain such code to change configuration options, then connect to the network and check to make sure the changes have taken effect.
    • config
      • unix.exp
    • lib
      • whois.exp This file will be run as a tool init file.

Other Files

  • site.exp This file is a directory specific configuration file for runtest. If you always use the same options, you may want to put them here rather than typing them every time. You can record any variables that you'd be able to use 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)
  • .dejagnurc This is a personal configuration file. Each developer can have their own one to personalize their current DejaGnu operating environment. This file should be located in the user's home directory (~/.dejagnurc)
  • global_config.exp This is the first configuration file loaded. It can be named anything but must be pointed to by the $DEJAGNU environment variable (set when your terminal loads).

External links

Personal tools

Served in 0.140 secs.