Documentation
¶
Index ¶
- func CopyAllFromFS(t *testing.T, srcFS fs.FS, destinationPath string)
- func CopyFileFromFSToDisk(srcFS fs.FS, srcPath string, destPath string) error
- func GetFileFromGenerationResult(t *testing.T, res *GenerationResult, path string) string
- func RunTestInE2ERunner(t *testing.T, res *GenerationResult, testCode string)
- type GenerationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileFromFSToDisk ¶
func GetFileFromGenerationResult ¶ added in v1.3.0
func GetFileFromGenerationResult(t *testing.T, res *GenerationResult, path string) string
GetFileFromGenerationResult returns the contents of an output file from a GenerationResult.
func RunTestInE2ERunner ¶
func RunTestInE2ERunner(t *testing.T, res *GenerationResult, testCode string)
Types ¶
type GenerationResult ¶
type GenerationResult struct {
Req *pluginpb.CodeGeneratorRequest
Resp *pluginpb.CodeGeneratorResponse
}
func RunGeneratorForFiles ¶
func RunGeneratorForFiles(t *testing.T, generator codegen.FileGeneratorFunc, fs fs.FS, files ...string) *GenerationResult
RunGeneratorForFiles runs a codegen.FileGeneratorFunc for a specific set of proto files. Internally it creates a code generation requests and creates a new plugin instance. It then invokes the generator and returns the code generation response from the plugin.
Click to show internal directories.
Click to hide internal directories.