Skip to content

Per-axis tests for nodl_generator_cpp + parameter_traits link fix#78

Open
lsy3 wants to merge 2 commits into
ros-tooling:emerson/nodl-generator-cppfrom
lsy3:lsy3/test-nodl-generator-cpp
Open

Per-axis tests for nodl_generator_cpp + parameter_traits link fix#78
lsy3 wants to merge 2 commits into
ros-tooling:emerson/nodl-generator-cppfrom
lsy3:lsy3/test-nodl-generator-cpp

Conversation

@lsy3

@lsy3 lsy3 commented May 26, 2026

Copy link
Copy Markdown

Stacks on emerson/nodl-generator-cpp.

In the process of reviewing this PR I built tests to understand the generator. Figured the scaffolding would be useful, so opening this PR. Also surfaced a small bug — generated code wouldn't compile when the NoDL doc declared parameters:.

Commit 1 — parameter_traits link fix: generated params header includes <parameter_traits/parameter_traits.hpp> but the macro didn't find or link it. Adds find_package + link in the extras/macro and the <depend> in package.xml.

Commit 2 — Split test_nodl_generator_cpp into per-axis fixtures: one fixture per generator codepath so failures point at exactly one axis. See plan_cpp_tests.md.

Axis What it proves
pubsub Round-trip: harness → generated sub → derived callback → generated pub → harness.
service Generated server dispatches into callback; generated client calls a harness server.
params Defaults populated, params declared on node, read_only propagates to descriptor.
lifecycle configure → activate works; and publishing before activate is silently dropped (subscription still fires).

Tested on Jazzy (arm64 container): 14 tests, 0 failures. Untested on Humble/Iron — parameter_traits rosdep key may differ.

@luke-alloy luke-alloy force-pushed the lsy3/test-nodl-generator-cpp branch from 1e608fd to 54fc12e Compare May 26, 2026 21:02
lsy3 added 2 commits May 27, 2026 07:04
The generated params header includes <parameter_traits/parameter_traits.hpp>,
but the macro didn't find or link it — downstream packages that consume
nodl_generate_cpp() with a NoDL file declaring `parameters:` failed to build
with "parameter_traits/parameter_traits.hpp: No such file or directory".

Add find_package(parameter_traits) to the extras and link
parameter_traits::parameter_traits in the macro so consumers get the include
path and library transitively. Declare the runtime dependency in package.xml.

Signed-off-by: lsy3 <sylukewicent@gmail.com>
Replace the single monolithic test_node fixture (which mixed pub/sub +
params in one YAML) with four single-axis fixtures so a failure in any
one test points at exactly one generator codepath. See plan_cpp_tests.md
for the rationale and rollout order.

Axes covered:
- pubsub: end-to-end round-trip — harness publishes on /echo_in, derived
  node's generated subscription dispatches into on_echo_in, derived
  republishes through the generated publisher on /echo_out, harness
  subscribes and confirms payload survived the round-trip.
- service: harness client calls derived's generated /add server (asserts
  callback dispatch + computed response); derived's generated client
  calls harness server on /delegate_add (asserts client wiring).
- params: defaults survive YAML -> generated round-trip, params declared
  on the node, read_only flag propagates to the parameter descriptor.
- lifecycle: drives configure -> activate, exercises round-trip after
  activation, and proves the lifecycle-specific property — publishing
  before activate is silently dropped while the subscription still fires.

Each axis follows the three-layer split: generated base (from
nodl_generate_cpp) / derived class (handwritten "user" code) / gtest.

Removes the old test_node.nodl.yaml + test_generated_node.cpp now that
both their axes are covered cleanly.

Signed-off-by: lsy3 <sylukewicent@gmail.com>
@luke-alloy luke-alloy force-pushed the lsy3/test-nodl-generator-cpp branch from 54fc12e to cb6a14c Compare May 26, 2026 21:04
@lsy3

lsy3 commented May 26, 2026

Copy link
Copy Markdown
Author

@emersonknapp tagging you — this stacks on your nodl_generator_cpp PR. Would love a look when you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant