Link files

Code Coverage for Ada

Link files are the library management system used for Ada Coverage. These libraries contain the entire Ada compilation units contained by compiler sources, the predefined Ada environment and the source files of your projects. You must use link files when using Code Coverage in Ada for the Ada Coverage analyzer to correctly analyze your source code.

You can include a link file within another link file, which is an easy way to manage your source code.

Link File Syntax

Link files have a line-by-line syntax. Comments start with a double hyphen (--), and end at the end of the line. Lines can be empty.

There are two types of configuration lines:

<link filename> LINK

<source filename> <full unit name> <type> [ada83]

 

The <type> is one of the following flags:

Use the optional ada83 flag if the source file cannot be compiled in Ada 95 mode, and must be analyzed in Ada 83 mode.

Generating a Link File

The link file can be generated either manually or automatically with the Ada Link File Generator (attolalk) tool. See the HCL OneTest Embedded Reference section of the help for more information about command line tools.

Sending the Link File to the Instrumentor

The loading order of link files is important. If the same unit name is found twice or more in one (or more) loaded link files, the Instrumentor issues a warning and uses the last encountered unit.

Included link files are analyzed when the file including the link file is loaded.

In Ada, Code Coverage loads the link files in the following order:

Now, you can start analyzing the file instrument.

Loading A Permanent Link File

You can ask Code Coverage to load the link file at each execution.  To do that, set the environment variable ATTOLCOV_ADALINK with the link filename separated by ':' on a UNIX system, or ';' in Windows.  For example:

ATTOLCOV_ADALINK="compiler.alk/projects/myproject/myproject.alk"

 

A Link file specified on the command line is loaded after the link file specified by this environment variable.

Related Topics

Selecting coverage typesCode Coverage settings