ParseTextproto parses a test suite file in Textproto format.
(path string)
| 256 | |
| 257 | // ParseTextproto parses a test suite file in Textproto format. |
| 258 | func (p *tsParser) ParseTextproto(path string) (*conformancepb.TestSuite, error) { |
| 259 | if path == "" { |
| 260 | return nil, nil |
| 261 | } |
| 262 | if fileFormat := compiler.InferFileFormat(path); fileFormat != compiler.TextProto { |
| 263 | return nil, fmt.Errorf("invalid file extension wanted: .textproto: found %v", fileFormat) |
| 264 | } |
| 265 | testSuite := &conformancepb.TestSuite{} |
| 266 | data, err := os.ReadFile(path) |
| 267 | if err != nil { |
| 268 | return nil, fmt.Errorf("os.ReadFile(%q) failed: %v", path, err) |
| 269 | } |
| 270 | err = prototext.Unmarshal(data, testSuite) |
| 271 | return testSuite, err |
| 272 | } |
| 273 | |
| 274 | // ParseYAML parses a test suite file in YAML format. |
| 275 | func (p *tsParser) ParseYAML(path string) (*test.Suite, error) { |
nothing calls this directly
no test coverage detected