Documentation
¶
Overview ¶
plugintest provides utilities for black-box testing of protoc.Plugin implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithConfiguration ¶
func WithConfiguration(options ...PluginConfigurationOption) *protoc.PluginConfiguration
WithConfiguration creates a new PluginConfiguration and applies all the given options.
func WithDirectives ¶
WithDirectives assigns rule Directives.
Types ¶
type Case ¶
type Case struct { // The base name of the proto file to mock parse. If not set, defaults to 'test' ('test.proto') Basename string // The relative package path Rel string // The configuration Name PluginName string // Optional directives for the package config Directives []rule.Directive // The input proto file source. "syntax = proto3" will be automatically prepended. Input string // The expected value for the final configuration state Configuration *protoc.PluginConfiguration // Whether to perform integration test portion of the test SkipIntegration bool }
Case holds the inputs and expected outputs for black-box testing of a plugin implementation.
func (*Case) RunIntegration ¶
type PluginConfigurationOption ¶
type PluginConfigurationOption func(c *protoc.PluginConfiguration)
PluginConfigurationOption modifies a configuration in-place
func WithLabel ¶
func WithLabel(t *testing.T, raw string) PluginConfigurationOption
WithLabel assigns the Label field.
func WithOptions ¶
func WithOptions(options ...string) PluginConfigurationOption
WithOptions assigns the Options field.
func WithOutputs ¶
func WithOutputs(outputs ...string) PluginConfigurationOption
WithOutputs assigns the Outputs field.
Click to show internal directories.
Click to hide internal directories.