---
name: "Test::Lintian::Templates"
section: "3"
platform: "linux"
package: "lintian"
version: "2.122.0"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test::Lintian::Templates"
---

# Test::Lintian::Templates(3)

## NAME

Test::Lintian::Templates -- Helper routines dealing with templates

## SYNOPSIS

use Test::Lintian::Templates qw(fill\_template);

my `$data` = { 'placeholder' =\> 'value' }; my `$file` = '/path/to/generated/file';

fill\_template("$file.in", `$file`, `$data`);

## DESCRIPTION

Routines for dealing with templates in Lintian test specifications.

## FUNCTIONS

- copy\_skeleton\_template\_sets(INSTRUCTIONS, RUN\_PATH, SUITE, TEST\_SET)

  Copies template sets belonging to SUITE into the test working directory RUN\_PATH according to INSTRUCTIONS. The INSTRUCTIONS are the target directory relative to RUN\_PATH followed by the name of the template set in parentheses. Multiple such instructions must be separated by commas.

- remove\_surplus\_templates(SRC\_DIR, TARGET\_DIR)

  Removes from TARGET\_DIR any templates that have corresponding originals in SRC\_DIR.

- fill\_skeleton\_templates(INSTRUCTIONS, HASH, EPOCH, RUN\_PATH, TEST\_SET)

  Fills the templates specified in INSTRUCTIONS using the data in HASH. Only fills templates when the generated files are not present or are older than either the file modification time of the template or the age of the data as evidenced by EPOCH. The INSTRUCTIONS are the target directory relative to RUN\_PATH followed by the name of the whitelist in parentheses. Multiple instructions must be separated by commas.

- fill\_whitelisted\_templates(DIR, WHITE\_LIST, HASH, HASH\_EPOCH)

  Generates all files in array WHITE\_LIST relative to DIR from their templates, which are assumed to have the same file name but with extension '.in', using data provided in HASH. The optional argument HASH\_EPOCH can be used to preserve files when no generation is necessary.

- fill\_all\_templates(HASH, DIR)

  Fills all templates in DIR with data from HASH.

- fill\_template(TEMPLATE, GENERATED, HASH, HASH\_EPOCH, DELIMITERS)

  Fills template TEMPLATE with data from HASH and places the result in file GENERATED. When given HASH\_EPOCH, will evaluate beforehand if a substitution is necessary based on file modification times. The optional parameter DELIMITERS can be used to change the standard delimiters.
