LinuxCommandLibrary

lit

LLVM's integrated tester

TLDR

Run tests

$ lit [tests/]
copy
Run specific test
$ lit [test.py]
copy
Verbose output
$ lit -v [tests/]
copy
Show all output
$ lit -a [tests/]
copy
Parallel execution
$ lit -j [4] [tests/]
copy
Filter tests
$ lit --filter [pattern] [tests/]
copy

SYNOPSIS

lit [options] tests

DESCRIPTION

lit (LLVM Integrated Tester) is a portable test execution framework designed for running compiler and tool test suites. It discovers test files in directory trees, executes them according to configurable test formats, and reports results with support for parallel execution across multiple threads. Tests are typically small scripts with embedded RUN lines that specify the commands to execute and CHECK lines that define expected output patterns.
The framework supports multiple test formats including ShTest (shell-script-style tests interpreted by lit itself), GoogleTest binaries, and custom formats defined through Python configuration files. Each test directory contains a `lit.cfg` or `lit.cfg.py` file that specifies the test format, available substitutions, and environment configuration. Although lit was built for LLVM's own test infrastructure, it is a general-purpose tool that can be used to test any command-line program.

PARAMETERS

TESTS

Test files or directories.
-v
Verbose output.
-a
Show all output.
-j N
Number of parallel jobs.
--filter PATTERN
Run matching tests only.
--no-progress-bar
Disable progress bar.
--help
Display help information.

CAVEATS

Primarily for LLVM projects. Requires test configuration. Python-based.

HISTORY

lit was developed as part of the LLVM project to provide a flexible, fast testing framework for compiler tests.

SEE ALSO

llvm-lit(1), pytest(1), make(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community