| description | Reference for the codeql resolve tests command |
|---|
The codeql resolve tests command is used to find CodeQL unit tests in given directories.
The following is an example use of the command for finding all strictly testable queries under the languages/ directory, which should return a text list of .qlref files:
codeql resolve tests --format=text --strict-test-discovery -- languages/The codeql resolve tests command can be pointed as a query (.ql) file, a query test reference (aka .qlref) file, or a test directory path. Pointing at the query (.ql) file will just resolve the absolute path of that query file, while it is more useful to point at a test directory or a .qlref file with --strict-test-discovery set:
# Resolve tests for a specific .qlref file, using `json` as the output format.
codeql resolve tests --format=json --strict-test-discovery -- \
languages/<language>/<pack-basename>/test/<QueryBasename>/<QueryBasename>.qlrefWhich will produce outpout similar to the following:
[
"/example-path-to/git-base/codeql-development-template/languages/<language>/tools/test/PrintAST/PrintAST.qlref"
]Run codeql resolve tests -h for more information.
Run codeql resolve tests -h -vv for much more information.
codeql pack install- Install library dependencies declared in a CodeQL pack.
codeql test run- Run the resolved tests.codeql test accept- Accept test results as expected output.