---
name: "gnattest"
section: "1"
platform: "linux"
package: "asis-programs"
version: "2019-5"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/gnattest"
---

# gnattest(1)

Create AUnit test skeletons and harness for a project

## NAME

gnattest - Create AUnit test skeletons and harness for a project

## SYNOPSIS

**gnattest** **-P***projname* \[**-harness-dir=***dirname*\] \[*switches*\] \[*filename*\] \[**-cargs** *gcc\_switches*\]

## DESCRIPTION

**gnattest** is an ASIS-based utility that creates unit-test skeletons as well as a test driver infrastructure (harness). **gnattest** creates a skeleton for each visible subprogram in the packages under consideration when they do not exist already.

In order to process source files from a project, **gnattest** has to semantically analyze the sources. Therefore, test skeletons can only be generated for legal Ada units.

If a unit is dependent on other units, those units should be among the source files of the project or of other projects imported by this one.

Generated skeletons and harnesses are based on the AUnit testing framework. AUnit is an Ada adaptation of the xxxUnit testing frameworks, similar to JUnit for Java or CppUnit for C++.

While it is advised that gnattest users read the AUnit manual, deep knowledge of AUnit is not necessary for using gnattest. For correct operation of gnattest, the **libaunit***V***-dev** package should be installed. The appropriate version *V* is given in the **Recommends** field of the **asis-programs** package (the one containing this manual page).

## SEE ALSO

[gnat(1)](/gnat/1.md), [asistant(1)](/asistant/1.md), [gnat2xml(1)](/gnat2xml/1.md), [gnatcheck(1)](/gnatcheck/1.md), [gnatelim(1)](/gnatelim/1.md), [gnatmetric(1)](/gnatmetric/1.md), [gnatpp(1)](/gnatpp/1.md), [gnatstub(1)](/gnatstub/1.md)

Documentation about the ASIS tools may be found in */usr/share/doc/asis-doc/* if the **asis-doc** package is installed.

The reference documentation about **gnattest**, the GNAT User Guide, can unfortunately not be distributed by Debian due to license problems, but may be found in various formats at *https://gcc.gnu.org/onlinedocs/*.
