mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
This adds the possibility to add a special `proc_macro.rs` source file to QL tests, which will be generated into a `proc_macro` crate the usual `lib` crate depends on. This allow to define procedural macros in QL tests, and is here used to move the `macro-expansion` integration test to be a language test instead. As the generated manifests involved were starting to get a bit complex, they are now generated from a `mustache` template.
43 lines
761 B
Plaintext
43 lines
761 B
Plaintext
{{#Workspace}}
|
|
[workspace]
|
|
resolver = "2"
|
|
members = [".lib", ".proc_macro"]
|
|
{{/Workspace}}
|
|
|
|
{{#Lib}}
|
|
{{^uses_proc_macro}}
|
|
[workspace]
|
|
{{/uses_proc_macro}}
|
|
[package]
|
|
name = "test"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
[lib]
|
|
path = "{{#uses_proc_macro}}../{{/uses_proc_macro}}lib.rs"
|
|
{{#uses_main}}
|
|
[[bin]]
|
|
name = "main"
|
|
path = "{{#uses_proc_macro}}../{{/uses_proc_macro}}main.rs"
|
|
{{/uses_main}}
|
|
[dependencies]
|
|
{{#uses_proc_macro}}
|
|
proc_macro = { path = "../.proc_macro" }
|
|
{{/uses_proc_macro}}
|
|
{{#dependencies}}
|
|
{{.}}
|
|
{{/dependencies}}
|
|
{{/Lib}}
|
|
|
|
{{#Macro}}
|
|
[package]
|
|
name = "proc_macro"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
[lib]
|
|
path = "../proc_macro.rs"
|
|
proc_macro = true
|
|
[dependencies]
|
|
quote = "1.0.40"
|
|
syn = { version = "2.0.100", features = ["full"] }
|
|
{{/Macro}}
|