Misplaced Pages

DejaGnu

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
GNU software testing framework Not to be confused with DjVu, a computer file format for storing scanned documents.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
The topic of this article may not meet Misplaced Pages's notability guidelines for products and services. Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.
Find sources: "DejaGnu" – news · newspapers · books · scholar · JSTOR (August 2011) (Learn how and when to remove this message)
This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources.
Find sources: "DejaGnu" – news · newspapers · books · scholar · JSTOR (August 2011) (Learn how and when to remove this message)
This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (December 2020) (Learn how and when to remove this message)
(Learn how and when to remove this message)

GNU DejaGnu
Developer(s)GNU Project
Stable release1.6.3 Edit this on Wikidata / 16 June 2021; 3 years ago (16 June 2021)
Repository
Operating systemCross-platform
PlatformGNU
TypeFramework for testing
LicenseGNU General Public License
Websitewww.gnu.org/software/dejagnu

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. 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 popular with many GNU projects, at universities, and for private companies.

Files

Essential Files

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

Other Files

  • site.exp This file is a directory specific configuration file for 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)
  • .dejagnurc This is a personal configuration file, which 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).

References

  1. Jacob Bachmeyer (17 June 2021). "DejaGnu 1.6.3 released". Retrieved 2 July 2021.

External links

Categories:
DejaGnu Add topic