Documentation ¶
Index ¶
- Variables
- func CompareResults(t *testing.T, actualString []byte, referenceString []byte) error
- func EnrichOptionsWithOptionsForTesting(t *testing.T, _options ...options.WithOption) []options.WithOption
- func ExplodingGlobalLogger(hardExplode bool)
- func ParseDriverTestsuiteXml(t *testing.T, testPath string) *xmldom.Node
- func ParseParserSerializerTestSuiteXml(t *testing.T, testPath string) *xmldom.Node
- func ProduceTestingLogger(t TestingLog) zerolog.Logger
- func RunDriverTestsuite(t *testing.T, driver plc4go.PlcDriver, testPath string, parser XmlParser, ...)
- func RunParserSerializerTestsuite(t *testing.T, testPath string, parser Parser, options ...options.WithOption)
- func TestContext(t *testing.T) context.Context
- func WithRootTypeParser(rootTypeParser func(utils.ReadBufferByteBased) (any, error)) config.WithOption
- func WithSkippedTestCases(skippedTestCases ...string) config.WithOption
- type ConnectionConnectAwaiter
- type DriverTestStep
- type DriverTestcase
- type DriverTestsuite
- func (m DriverTestsuite) ExecuteStep(t *testing.T, connection plc4go.PlcConnection, testcase *DriverTestcase, ...) error
- func (DriverTestsuite) LogDelimiterSection(t *testing.T, delimiter, format string, a ...any)
- func (m DriverTestsuite) Run(t *testing.T, driverManager plc4go.PlcDriverManager, testcase DriverTestcase) error
- type ManualTestCase
- type ManualTestSuite
- type Parser
- type ParserSerializerTestcase
- type ParserSerializerTestsuite
- type StepType
- type TestTransportInstance
- type TestingLog
- type WithTestCaseOption
- type XmlParser
Constants ¶
This section is empty.
Variables ¶
View Source
var DriverTestsuiteConnectTimeout = 30 * time.Second
Functions ¶
func CompareResults ¶
func EnrichOptionsWithOptionsForTesting ¶
func EnrichOptionsWithOptionsForTesting(t *testing.T, _options ...options.WithOption) []options.WithOption
EnrichOptionsWithOptionsForTesting appends options useful for testing to config.WithOption s
func ExplodingGlobalLogger ¶
func ExplodingGlobalLogger(hardExplode bool)
ExplodingGlobalLogger Useful to find unredirected logs
func ParseDriverTestsuiteXml ¶
func ProduceTestingLogger ¶
func ProduceTestingLogger(t TestingLog) zerolog.Logger
ProduceTestingLogger produces a logger which redirects to testing.T
func RunDriverTestsuite ¶
func TestContext ¶
TestContext produces a context which is getting cleaned up by testing.T
func WithRootTypeParser ¶
func WithRootTypeParser(rootTypeParser func(utils.ReadBufferByteBased) (any, error)) config.WithOption
WithRootTypeParser can be used to output the root type of protocol for better debugging
func WithSkippedTestCases ¶
func WithSkippedTestCases(skippedTestCases ...string) config.WithOption
WithSkippedTestCases can be used to skip test cases
Types ¶
type ConnectionConnectAwaiter ¶
type ConnectionConnectAwaiter interface { // SetAwaitSetupComplete sets a flag that the driver should await a connection completion SetAwaitSetupComplete(awaitComplete bool) // SetAwaitDisconnectComplete sets a flag that the driver should await a dis-connection completion SetAwaitDisconnectComplete(awaitComplete bool) }
type DriverTestStep ¶
type DriverTestStep struct {
// contains filtered or unexported fields
}
func ParseDriverTestsuiteSteps ¶
func ParseDriverTestsuiteSteps(t *testing.T, node xmldom.Node) ([]DriverTestStep, error)
type DriverTestcase ¶
type DriverTestcase struct {
// contains filtered or unexported fields
}
type DriverTestsuite ¶
type DriverTestsuite struct {
// contains filtered or unexported fields
}
func ParseDriverTestsuite ¶
func ParseDriverTestsuite(t *testing.T, node xmldom.Node, parser XmlParser, rootTypeParser func(utils.ReadBufferByteBased) (any, error)) *DriverTestsuite
func (DriverTestsuite) ExecuteStep ¶
func (m DriverTestsuite) ExecuteStep(t *testing.T, connection plc4go.PlcConnection, testcase *DriverTestcase, step DriverTestStep) error
func (DriverTestsuite) LogDelimiterSection ¶
func (DriverTestsuite) LogDelimiterSection(t *testing.T, delimiter, format string, a ...any)
func (DriverTestsuite) Run ¶
func (m DriverTestsuite) Run(t *testing.T, driverManager plc4go.PlcDriverManager, testcase DriverTestcase) error
type ManualTestCase ¶
type ManualTestSuite ¶
type ManualTestSuite struct { ConnectionString string DriverManager plc4go.PlcDriverManager TestCases []ManualTestCase // contains filtered or unexported fields }
func NewManualTestSuite ¶
func NewManualTestSuite(t *testing.T, connectionString string, driverManager plc4go.PlcDriverManager) *ManualTestSuite
func (*ManualTestSuite) AddTestCase ¶
func (m *ManualTestSuite) AddTestCase(address string, expectedReadValue any, testCaseOptions ...WithTestCaseOption)
func (*ManualTestSuite) Run ¶
func (m *ManualTestSuite) Run() plc4go.PlcConnection
type ParserSerializerTestcase ¶
type ParserSerializerTestcase struct {
// contains filtered or unexported fields
}
type ParserSerializerTestsuite ¶
type ParserSerializerTestsuite struct {
// contains filtered or unexported fields
}
func ParseParserSerializerTestSuite ¶
func ParseParserSerializerTestSuite(t *testing.T, node xmldom.Node, parser Parser, rootTypeParser func(utils.ReadBufferByteBased) (any, error)) *ParserSerializerTestsuite
func (*ParserSerializerTestsuite) Run ¶
func (p *ParserSerializerTestsuite) Run(t *testing.T, testcase ParserSerializerTestcase) error
type StepType ¶
type StepType uint8
const ( StepTypeOutgoingPlcMessage StepType = 0x01 StepTypeOutgoingPlcBytes StepType = 0x02 StepTypeIncomingPlcMessage StepType = 0x03 StepTypeIncomingPlcBytes StepType = 0x04 StepTypeApiRequest StepType = 0x05 StepTypeApiResponse StepType = 0x06 StepTypeDelay StepType = 0x07 StepTypeTerminate StepType = 0x08 )
type TestTransportInstance ¶
type TestTransportInstance interface { transports.TransportInstance FillReadBuffer(data []byte) GetNumDrainableBytes() uint32 DrainWriteBuffer(numBytes uint32) []byte }
type TestingLog ¶
type TestingLog interface { Log(args ...interface{}) Logf(format string, args ...interface{}) Helper() }
type WithTestCaseOption ¶
type WithTestCaseOption func(testCase ManualTestCase)
func WithUnwrappedValue ¶
func WithUnwrappedValue(unwrap bool) WithTestCaseOption
WithUnwrappedValue is a WithTestCaseOption which can be used to control if plc4go.PlcValue
Click to show internal directories.
Click to hide internal directories.