class Workflow

Defined at line 116 of file ../../src/sys/fuzzing/common/runner.h

Represents a single fuzzing workflow, e.g. |TryOne|, |Minimize|, etc. It holds a pointer to

the object that created it, but this is safe: it cannot outlive the object it is a part of.

It should be used in the normal way, e.g. using |wrap_with|.

Derived runners should include a `Workflow` member, and use it to wrap any returned promises

that are exclusive with a fuzzing workflow, e.g. the workflows themselves and method like

`Configure`. Promises that are a part of a workflow can be wrapped with the workflow's

`scope()`.

Public Methods

ZxPromise<> Stop ()

Returns a promise to stop the current workflow. The promise completes after |Finish| is

called.

Defined at line 127 of file ../../src/sys/fuzzing/common/runner.cc

void Workflow (Runner * runner)

Defined at line 136 of file ../../src/sys/fuzzing/common/runner.h

void ~Workflow ()

Defined at line 137 of file ../../src/sys/fuzzing/common/runner.h

Scope & scope ()

Defined at line 139 of file ../../src/sys/fuzzing/common/runner.h

template <typename Promise>
decltype(auto) wrap (Promise promise, Mode mode)

Use |wrap_with(workflow_)| on promises that implement a workflow's behavior to create scoped

actions on set up and tear down.

Defined at line 144 of file ../../src/sys/fuzzing/common/runner.h

Enumerations

enum Mode
Name Value
kStart 0
kFinish 1
kBoth 2
kNeither 3

In most cases, a fuzzing workflow is encapsulated by a promise returned by a single method,

e.g. `Fuzz`. In this case, the promise is wrapped by a `Workflow` that both starts and

finishes the workflow.

If a workflow spans multiple promises from multiple methods, each method may specify a `mode`

when wrapping its promise. For example, if a workflow is made up of 3 promises from 3

different methods:

* The first may wrap its promise with `.wrap_with(workflow_, Workflow::Mode::kStart);`.

* The second may wrap its promise with `.wrap_with(workflow_, Workflow::Mode::kNeither);`.

* The last may wrap its promise with `.wrap_with(workflow_, Workflow::Mode::kFinish);`.

Defined at line 129 of file ../../src/sys/fuzzing/common/runner.h