LINTIAN::TUTORIAL::TESTSUITE(3)

πŸ’– NAME πŸ’–

Lintian::Tutorial::TestSuite β€” a quick lil intro to running the Lintian testsuite πŸŽ€


✨ SYNOPSIS ✨

⚠️ Warning, bestie: this document may be out of date. (iykyk, docs be like that 😭)

Okay so this guide is gonna speedrun you through running the Lintian test suite plus some cute tricks. Heads up though β€” the Lintian test suite is fairly large, so running it can take a substantial amount of time. 🐌 To keep development from being a whole thing, there are various options that limit which tests actually run.

If you're looking for a guide on how to write tests instead of run them, go check out Lintian::Tutorial::WritingTests. 🫢


🌸 DESCRIPTION 🌸

The Lintian test suite is an extensive collection of various test cases. It's split into 4 "sub-suites", and rn the majority of the tests live in the "tests" sub-suite. πŸ‘‘

To run the whole entire suite:

$ rm -rf debian/test-out; private/build-test-packages; private/runtests

But like… while you're writing a new tag (or a check), you probably only wanna run a particular (subset of the) test(s). Scroll on down to "Running a subset of the tests" for the options available. ⭐

🧚 Running a subset of the tests

First things first, you gotta build the test packages with:

$ rm -rf debian/test-out; private/build-test-packages;

Then these options are available to you:

πŸ“ Running a single test

To run a single test by its name, use:

$ private/runtests --onlyrun=test:$name

πŸ’… Running all tests for a check

To run all the tests for a given check, use:

$ private/runtests --onlyrun=check:$name

$check must be the name of a check (it will test for checks/$check.desc) or "legacy". This runs all tests that start with "$check-". Periodt. ✨

πŸ¦‹ Running all tests designed for a specific tag

To run all tests that have a "Test-For" or a "Test-Against" for a given tag, use:

$ private/runtests --onlyrun=tag:$name

🌈 Running tests under coverage

Not me telling you this feature is currently untested πŸ™ˆ

It is possible to run most of the tests under Devel::Cover. You do this by passing --coverage to private/runtests. Example time:

$ private/runtests --coverage --dump-logs -j1 -k t debian/test-out

Please note that Devel::Cover does not seem to handle multiple threads too well. You may see spurious warnings/errors if you run the tests with 2 or more active worker threads. πŸ’€

Caveat 1: Coverage for collections (i.e. programs in collection/) does not seem to work at the moment. Therefore, they often end up with (next to) zero coverage in the generated reports. 😭

Caveat 2: Devel::Cover sometimes changes the output of Lintian or tools called by Lintian. Obviously, this leads to test failures. Therefore, you may see weird test failures (or warnings) when running under coverage. πŸ™ƒ

πŸ‘‘ Collecting the coverage you want in a reasonable time

Collecting coverage is excruciatingly slow. This is not helped by the fact that it becomes unreliable when run under 2 or more threads.

Fortunately, Devel::Cover "appends" to its cover database. This allows you to "slowly" build up the coverage database over multiple runs. Example:

$ private/runtests --coverage --dump-logs -j1 -k t debian/test-out suite:scripts
$ private/runtests --coverage --dump-logs -j1 -k t debian/test-out suite:debs
$ private/runtests --coverage --dump-logs -j1 -k t debian/test-out suite:source
...

Or:

$ private/runtests --coverage --dump-logs -j1 -k t debian/test-out $check
$ private/runtests --coverage --dump-logs -j1 -k t debian/test-out legacy

🫢 SEE ALSO 🫢

  • Lintian::Tutorial::WritingTests

okay that's the whole page bestie, you ate that πŸ’… this was Lintian v2.139.0ubuntu2, dated 2026-10-08, and it's the Lintian::Tutorial::TestSuite(3) page β€” slay, go run some tests πŸŽ€βœ¨

πŸ“¦ where this page comes from