DejaGnu

From Wikipedia, the free encyclopedia
(Redirected from Dejagnu)
Jump to navigation Jump to search

Template:Short description Script error: No such module "Distinguish". Script error: No such module "Unsubst". Template:Use dmy dates Script error: No such module "Infobox".Template:Template other Script error: No such module "Check for unknown parameters".Script error: No such module "Check for conflicting parameters". Script error: No such module "Portal". DejaGnu is a software 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 is licensed under the GPL. It is based on Expect, 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 and Sybase to test their products.Script error: No such module "Unsubst". 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 <templatestyles src="Mono/styles.css" />runtest in the root project directory.

 runtest --tool program_to_test

This will look in the <templatestyles src="Mono/styles.css" />testsuite directory for any folders starting with <templatestyles src="Mono/styles.css" />program_to_test and will run all .exp files in that folder.

Embedded design

One field for which DejaGnu is particularly well suitedScript error: No such module "Unsubst". 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.Script error: No such module "Unsubst". This mainly focuses on embedded targets and remote hosts. DejaGnu is thus popular with many GNU projects, Script error: No such module "Unsubst". at universities, and for private companies.

Files

Essential Files

  • <templatestyles src="Mono/styles.css" />testsuite
    • <templatestyles src="Mono/styles.css" />Apache Each directory in testsuite should contain tests for a specific tool. In this example, the tool being tested is the Apache webserver.
      • <templatestyles src="Mono/styles.css" />Apache.test1.exp 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.
    • <templatestyles src="Mono/styles.css" />config
      • <templatestyles src="Mono/styles.css" />unix.exp
    • <templatestyles src="Mono/styles.css" />lib
      • <templatestyles src="Mono/styles.css" />toolname.exp This file will be run as a tool init file for the tool called toolname.

Other Files

  • <templatestyles src="Mono/styles.css" />site.exp This file is a directory specific configuration file for <templatestyles src="Mono/styles.css" />runtest. 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)
  • <templatestyles src="Mono/styles.css" />.dejagnurc This is a personal configuration file, which should be located in the user's home directory (<templatestyles src="Mono/styles.css" />~/.dejagnurc)
  • <templatestyles src="Mono/styles.css" />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).

References

<templatestyles src="Reflist/styles.css" />

Script error: No such module "Check for unknown parameters".

External links