RclexTesting (RclexTesting (Experimental) v0.12.4)

Copy Markdown View Source

A Phoenix.LiveViewTest-style testing library for ROS2 applications built with rclex.

Provides a high-level scenario DSL for expressing robot behaviour as executable test specifications without manually managing nodes, publishers, subscriptions, or assertion loops.

Usage

defmodule RobotTest do
  use ExUnit.Case
  use RclexTesting

  scenario "robot starts mission" do
    watch "/robot/state", MyPkg.Msg.RobotState
    publish "/mission/start", MyPkg.Msg.MissionStart.new(id: 42)
    expect "/robot/state", &(&1.state == :running)
  end
end

DSL

The scenario DSL is organized into the following modules:

use RclexTesting imports every DSL module, scenario declarations, and RclexTesting.Matchers.