mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
This generates test source files from code blocks in class docstrings.
By default the test code is generated as is, but it can optionally:
* be wrapped in a function providing an adequate context using
`@rust.doc_test_function(name, *, lifetimes=(), return_type="()", **kwargs)`,
with `kwargs` providing both generic and normal params depending on
capitalization
* be skipped altogether using `@rust.skip_doc_test`
So for example an annotation like
```python
@rust.doc_test_function("foo",
lifetimes=("a",),
T="Eq",
x="&'a T",
y="&'a T",
return_type="&'a T")
```
will result in the following wrapper:
```rust
fn foo<'a, T: Eq>(x: &'a T, y: &'a T) -> &'a T {
// example code here
}
```
10 lines
366 B
Plaintext
10 lines
366 B
Plaintext
# configuration file for Swift code generation default options
|
|
--generate=dbscheme,rusttest,ql,rust
|
|
--dbscheme=ql/lib/rust.dbscheme
|
|
--ql-output=ql/lib/codeql/rust/generated
|
|
--ql-stub-output=ql/lib/codeql/rust/elements
|
|
--ql-test-output=ql/test/extractor-tests/generated
|
|
--rust-output=extractor/src/generated
|
|
--generated-registry=.generated.list
|
|
--script-name=codegen
|