Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2011-04-20 16:50:35
Size: 2288
Editor: NielsThykier
Revision 3 as of 2011-07-28 15:31:42
Size: 2349
Editor: NielsThykier
Comment: Putting it under the team namespace
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Lintian/HackersGuide
Line 9: Line 10:
{{{ {{{#!highlight sh

Hacking Lintian 101

This document aims to give a quick guide and a few hints to understanding Lintian.

Using Lintian from git

Lintian can be used directly from git; this allows developers to skip the boring build/install phase when testing the development version on real packages. To use lintian directly from git you need to set LINTIAN_ROOT (alternatively --root can be used) to the directory where the git clone is. The following script can be used for this:

   1 #!/bin/sh
   3 export LINTIAN_ROOT
   4 exec "$LINTIAN_ROOT/frontend/lintian" "$@"

Save that as run-lintian, make it executable, put it in your PATH and you are good to go.

Caveat 1: If LINTIAN_ROOT is not set, lintian will try to use the installed version of lintian, which most likely does not have the changes you would like to test.

Caveat 2: Lintian expects to have a standard locale, currently the version from git just uses the installed locale. This works fine as long as you also have Lintian installed (or if you already have the needed locale). In chroots or on minimum installs you may have to generate such a locale and set LOCPATH. Note, lintian will auto-generate this locale for running its test suite.

Running tests

There are a number of ways to run (parts of) the Lintian test suite. To run the entire test suite, simply use:

$ debian/rules runtests

It is also possible to run only a subset of the tests by using the "onlyrun" variable.

$ debian/rules runtests onlyrun=$test

Here $test can be one of:

  • The name of a test, in which case that specific test is run. This works regardless if the test is in the new or in the legacy test suite.
  • The name of a check, in which case all tests in t/tests that starts with $name will be run. If a legacy test happens to have the same name as a check, then this test is also run.

Finally it is also possible to only check for tests that are designed to trigger (or not trigger) a specific tag. For this use:

$ debian/rules check-tag tag=$tag

In this case, the test suite will run all tests that has $tag in its Test-For or Test-Against field. This cannot be used to run a test in the legacy test suite.