Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

stacy test

Run tests

Synopsis

stacy test <TEST> [OPTIONS]

Description

Discovers and runs test scripts from the tests/ or test/ directory. Tests are Stata scripts that use assertion commands. Supports filtering, parallel execution, and verbose output for debugging failures.

Each test runs with the project root as the working directory, so relative paths in tests resolve from the project root regardless of where stacy test is invoked. Use --directory <dir> to run tests in a specific directory, or --cd to run each test in its own parent directory.

Arguments

ArgumentDescription
<TEST>Specific test to run

Options

OptionDescription
--cdRun each test in its own parent directory
-C, --directoryRun tests in this directory
-f, --filterFilter tests by pattern
--listList tests without running
--parallelRun tests in parallel
-q, --quietSuppress progress output
-V, --verboseShow full log context for failures

Examples

Run all tests

stacy test

Run specific test

stacy test test_regression

Filter tests

stacy test -f 'regression*'

Run each test in its own directory

stacy test --cd

Exit Codes

CodeMeaning
0All tests passed
1One or more tests failed
5Test not found

See Exit Codes Reference for details.

See Also