Macro hotshot_macros::test_scripts

source ·
test_scripts!() { /* proc-macro */ }
Expand description

Macro to test multiple TaskState scripts at once.

Usage:

test_scripts[inputs, script1, script2, ...]

The generated test will:

  • take the first entry of inputs, which should be a Vec<HotShotEvent<TYPES>>,
  • feed this to each task in order, validating any output received before moving on to the next one,
  • repeat the previous steps, with the aggregated outputs received from all tasks used as the new input set,
  • repeat until no more output has been generated by any task, and finally
  • proceed to the next entry of inputs.

§Panics

The macro panics if the input stream cannot be parsed. The test will panic if the any of the scripts has a different number of stages from the input.