Unit Command.Test

Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables

Description

This unit contains procedures to configure and execute a command to create dipslay unit tests colored output. Also should display source code location for each failed test.

If a heap trace file is found on test project directory an output with possible leaks is generated.

Overview

Functions and Procedures

procedure TestCommand(ABuilder: ICommandBuilder);
procedure Registry(ABuilder: ICommandBuilder);
function GetTestExecutable(ABuilder: ICommandBuilder): string;

Description

Functions and Procedures

procedure TestCommand(ABuilder: ICommandBuilder);

This command recursively searches for a previously compiled test project from the current folder and runs it. At the end of the execution, an xml file with the same name as the test project is expected to be read. From this reading, a result is generated with the objective of highlighting the tests that failed, formatting the name of the source code file with a line and column in a format that vscode is able to understand and providing the developer with a link for quick navigation through the code.

If a memory leak trace file named heap.trc is found, the command also outputs information with details about the possible memory leaks in a format that vscode can provide easy navigation through the code.

Parameters
ABuilder
Command builder of the main application that will be used to output user instructions about the execution state of this command.
procedure Registry(ABuilder: ICommandBuilder);

Registry a test command using the command builder from pascli.

Parameters
ABuilder
Command builder of the main application that will be used to registry the command.
function GetTestExecutable(ABuilder: ICommandBuilder): string;

From the current directory it tries to locate an fpcunit compatible test project that has been previously compiled. Returns complete test file executable name. If the function returns empty, the project does not exist or is not of the expected type.

Parameters
ABuilder
Command builder of the main application that will be used to output info about the existence of the test project and whether it is valid.

Generated by PasDoc 0.16.0.