Перейти к содержанию

tt test

Build the package in the current directory and run its tests with luatest.

The directory must hold app.manifest.toml; no tt environment and no tt.yaml are involved. Tests are taken from test/, or from tests/ when there is no test/. SUB-PATHs relative to the project narrow the run to those directories and files, in the order given, and each must exist.

The build runs first, so components are compiled and .rocks/ holds the declared dependencies before any test does. luatest itself need not be declared: when [dev_dependencies] does not name it and the project tree does not already hold it, it is resolved as an implicit '*' requirement and installed. That resolution is not a declaration — app.manifest.toml and app.manifest.lock are left exactly as they were, so running the tests never makes the lock stale. -j N runs at most N jobs at once in each component build, as it does for tt package build.

Everything after '--' is handed to luatest, and the exit code is luatest's own.

Usage

tt test [SUB-PATH...] [-- LUATEST-ARGS...] [flags]

Flags

  • -C, --directory string - work on the project in DIR itself, not on the one the current directory is in
  • -j, --jobs N - run at most N jobs at once in each component build: the compiles of c and lua-c, cmake --build --parallel, cargo -j, go build -p, zig build -j, TT_BUILD_JOBS of make and shell; 0 is one a CPU

Examples

# Build and run everything under test/ (or tests/).
$ tt test

# Run one directory, then one file, then two directories in one run.
$ tt test test/integration
$ tt test test/unit/config_test.lua
$ tt test test/unit test/integration

# Pass luatest's own options through.
$ tt test -- --verbose --shuffle group