| description | Reference for the codeql test extract command |
|---|
The codeql test extract command is used to extract test databases from source code for testing purposes.
Build a dataset for a test directory.
Build a database for a specified test directory, without actually running any test queries. Outputs the path to the raw QL dataset to execute test queries against.
The following is an example use of the command for extracting test databases:
codeql test extract -- languages/<language>/<pack-basename>/test/The codeql test extract command can also extract specific tests and control the output:
# Extract a dataset (and create a database) from the test code source file(s)
# found in the specified (unit test) directory, which also should contain either
# the .ql query file to run or (more commonly) a .qlref file that points to the
# .ql query to be tested.
codeql test extract --
# Extract with threads for performance
codeql test extract --threads=4 test/
# Extract with custom options
codeql test extract --ram=8192 test/Run codeql test extract --help for more information.
Run codeql test extract --help --verbose for much more information.
codeql pack install- Install library dependencies declared in the test pack before attempting to extract the test dataset. The test pack also declares the extractor and corresponding database schema to use when creating the test database.codeql resolve queries- Resolve the local filesystem path of a target query (or queries)codeql resolve tests- Find and resolve the local filesystem paths of queries and/or query-tests
codeql test run- Run tests against extracted databasescodeql query run- Run queries against extracted test databases