Skip to content

How can I write unit tests for queries submitted to CodeQL repository #185

Discussion options

You must be logged in to vote

Yes!

https://help.semmle.com/codeql/codeql-cli/procedures/test-queries.html

Additionally, there is VS Code Support for running queries:

https://help.semmle.com/codeql/codeql-for-vscode/procedures/testing-queries.html

If the extractor has problems, or your test code fails to compile, the console output in VS Code won't tell you why you're having issues. You will want to look in the test directory your unit test is written under under tests.testproj/log.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JLLeitschuh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant