Add support for Go fuzz tests (#24107)
Add support for go fuzz tests. Closes #23809 Release Notes: - N/A --------- Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
parent
8edcaec1bf
commit
f45d58f01a
2 changed files with 26 additions and 0 deletions
|
@ -586,6 +586,23 @@ impl ContextProvider for GoContextProvider {
|
||||||
tags: vec!["go-benchmark".to_owned()],
|
tags: vec!["go-benchmark".to_owned()],
|
||||||
..TaskTemplate::default()
|
..TaskTemplate::default()
|
||||||
},
|
},
|
||||||
|
TaskTemplate {
|
||||||
|
label: format!(
|
||||||
|
"go test {} -fuzz=Fuzz -run {}",
|
||||||
|
GO_PACKAGE_TASK_VARIABLE.template_value(),
|
||||||
|
VariableName::Symbol.template_value(),
|
||||||
|
),
|
||||||
|
command: "go".into(),
|
||||||
|
args: vec![
|
||||||
|
"test".into(),
|
||||||
|
"-fuzz=Fuzz".into(),
|
||||||
|
"-run".into(),
|
||||||
|
format!("^{}\\$", VariableName::Symbol.template_value(),),
|
||||||
|
],
|
||||||
|
tags: vec!["go-fuzz".to_owned()],
|
||||||
|
cwd: package_cwd.clone(),
|
||||||
|
..TaskTemplate::default()
|
||||||
|
},
|
||||||
TaskTemplate {
|
TaskTemplate {
|
||||||
label: format!("go run {}", GO_PACKAGE_TASK_VARIABLE.template_value(),),
|
label: format!("go run {}", GO_PACKAGE_TASK_VARIABLE.template_value(),),
|
||||||
command: "go".into(),
|
command: "go".into(),
|
||||||
|
|
|
@ -59,6 +59,15 @@
|
||||||
(#set! tag go-benchmark)
|
(#set! tag go-benchmark)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
; Functions names start with `Fuzz`
|
||||||
|
(
|
||||||
|
(
|
||||||
|
(function_declaration name: (_) @run @_name
|
||||||
|
(#match? @_name "^Fuzz"))
|
||||||
|
) @_
|
||||||
|
(#set! tag go-fuzz)
|
||||||
|
)
|
||||||
|
|
||||||
; go run
|
; go run
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue