Fuzz tests code generation.
(fuzz []byte)
| 12 | |
| 13 | // Fuzz tests code generation. |
| 14 | func FuzzGenerate(fuzz []byte) int { |
| 15 | err := os.MkdirAll("fuzzing", os.ModePerm) |
| 16 | if err != nil { |
| 17 | panic("could not make fuzzing dir") |
| 18 | } |
| 19 | err = ioutil.WriteFile("fuzzing/input.go", fuzz, 0644) |
| 20 | if err != nil { |
| 21 | panic("could not write input file") |
| 22 | } |
| 23 | err = generator.GenerateFiles( |
| 24 | "go", |
| 25 | "fuzzing/input.go", |
| 26 | "fuzzing/output.go", |
| 27 | "", |
| 28 | true, |
| 29 | true, |
| 30 | ) |
| 31 | if err != nil { |
| 32 | return 0 |
| 33 | } |
| 34 | return 1 |
| 35 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…