blob: cbb3f0a1ac9bbeb955c7a31a212ff465e149a295 [file]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.validate.logs;
using fuchsia.mem;
type PuppetError = strict enum {
UnsupportedRecord = 1;
};
@discoverable
closed protocol EncodingPuppet {
/// Log takes a record and converts it into a buffer.
/// Returns an error if record contains unsupported type
strict Encode(struct {
record Record;
}) -> (resource struct {
result fuchsia.mem.Buffer;
}) error PuppetError;
};
@discoverable
closed protocol EncodingValidator {
/// Runs the encoding validation test suite and reports the results on the
/// given channel.
strict Validate(resource struct {
results server_end:ValidateResultsIterator;
});
};
closed protocol ValidateResultsIterator {
/// Returns the result of a test case execution.
strict GetNext() -> (resource table {
1: result ValidateResult;
});
};
type ValidateResult = strict union {
/// Set when the test case passed.
1: success TestSuccess;
/// Set when the test case failed.
2: failure TestFailure;
};
type TestSuccess = struct {
/// The name of the test case.
test_name string:MAX;
};
type TestFailure = struct {
/// The name of the test case.
test_name string:MAX;
/// The reason the test case failed.
reason string:MAX;
};