testutil

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyAllFromFS

func CopyAllFromFS(t *testing.T, srcFS fs.FS, destinationPath string)

func CopyFileFromFSToDisk

func CopyFileFromFSToDisk(srcFS fs.FS, srcPath string, destPath string) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL