Victoria.ExUnit (Victoria v0.2.0)

Copy Markdown View Source

ExUnit assertion helpers for Victoria conformance verification.

Verify one existing fixed trace:

import Victoria.ExUnit

assert_conform(
  Counter.Model,
  trace: "test/traces/counter.itf.json"
)

Or generate traces through a complete workflow and verify all of them:

{:ok, spec} =
  Victoria.Spec.new(
    source: "test/specs/Counter.tla",
    config: "test/specs/Counter.cfg"
  )

assert_conform(
  Counter.Model,
  spec,
  plan: [
    mode: :simulate,
    length: 10,
    max_run: 5
  ]
)

assert_conform/2 verifies one fixed trace. assert_conform/3 runs a generated conformance workflow and verifies every materialized trace.

Summary

Functions

Verifies one fixed trace and raises ExUnit.AssertionError on controlled failure.

Runs a generated workflow and raises ExUnit.AssertionError on controlled failure.

Functions

assert_conform(model, options)

@spec assert_conform(module(), [{:trace, Path.t() | Victoria.Trace.t()}]) :: :ok

Verifies one fixed trace and raises ExUnit.AssertionError on controlled failure.

assert_conform(model, spec, workflow_options)

@spec assert_conform(module(), Victoria.Spec.t(), keyword()) :: :ok

Runs a generated workflow and raises ExUnit.AssertionError on controlled failure.