Function example_tester::run_test

source ·
pub async fn run_test<'a, Fut, FutLogsReader>(
    protocol_name: &str,
    test_kind: TestKind<'a>,
    input_setter: impl FnOnce(RealmBuilder, ChildRef) -> Fut,
    logs_reader: impl Fn(ArchiveReader) -> FutLogsReader
) -> Result<(), Error>
where Fut: Future<Output = Result<(RealmBuilder, ChildRef), Error>> + 'a, FutLogsReader: Future<Output = ()> + 'a,
Expand description

Runs a test of the specified protocol, using one of the TestKinds enumerated above. The input_setter closure may be used to pass structured config values to the client, which is how the test is meant to receive its inputs. The logs_reader closure provides the raw logs collected from all child processes under test, allowing test authors to assert against the logged values. Note that these are raw logs - most users will want to process the logs into string form, which can be accomplished by passing the raw log vector to the logs_to_str helper function.