The test command is used to run the test suite for a parser.
tree-sitter test [OPTIONS] # Aliases: tOnly run tests whose names match this regex.
Skip tests whose names match this regex.
Only run tests from the given filename in the corpus.
The path to the directory containing the grammar.
Update the expected output of tests.
Tests containing `ERROR` nodes or `MISSING` nodes will not be updated.
Outputs parsing and lexing logs. This logs to stderr.
Compile the parser with debug flags enabled. This is useful when debugging issues that require a debugger like gdb or lldb.
Outputs logs of the graphs of the stack and parse trees during parsing, as well as the actual parsing and lexing message.
The graphs are constructed with [graphviz dot][dot], and the output is written to log.html.
Compile and run the parser as a Wasm module.
When using the --debug-graph option, open the log file in the default browser.
The path to an alternative configuration (config.json) file. See the init-config command for more information.
Force showing fields in test diffs.
Show parsing statistics when tests are being run. One of all, outliers-and-total, or total-only.
-
all: Show statistics for every test. -
outliers-and-total: Show statistics only for outliers, and total statistics. -
total-only: Show only total statistics.
Force a rebuild of the parser before running tests.
Only show the overview of the test results, and not the diff.