Skip to content

Add --disable-testing flag to workspace create - #318

Open
DasRoteSkelett wants to merge 1 commit into
b-robotized:masterfrom
DasRoteSkelett:feat/create-disable-testing
Open

Add --disable-testing flag to workspace create#318
DasRoteSkelett wants to merge 1 commit into
b-robotized:masterfrom
DasRoteSkelett:feat/create-disable-testing

Conversation

@DasRoteSkelett

Copy link
Copy Markdown

Summary

Add a --disable-testing flag to rtw workspace create. When set, the initial
colcon build is run with -DBUILD_TESTING=OFF, so test targets are not compiled.
Defaults to off — existing behaviour is unchanged.

Motivation

rtw workspace create runs an initial colcon build after importing the sources.
With BUILD_TESTING on (the ament default), that build also compiles every package's
test targets. A source dependency whose library builds fine but whose tests do not
(e.g. a test-only header missing from the released binary of an upstream package) then
fails the whole workspace creation, even though the workspace itself is fine.

--disable-testing lets creation complete in that case without hand-editing the
imported tree. colcon build does not run tests; this only skips compiling them.

Changes

  • workspace_utils.get_compile_cmd() gains a disable_testing parameter that appends
    -DBUILD_TESTING=OFF to the colcon build --cmake-args.
  • rtw workspace create gains the --disable-testing flag, threaded to every compile
    invocation (main and upstream workspace).
  • Documented in docs/rtwcli/index.rst.

Testing

  • rtw workspace create --help lists --disable-testing.
  • get_compile_cmd(..., disable_testing=True) emits
    --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF; the default
    emits only -DCMAKE_BUILD_TYPE=RelWithDebInfo.
  • Verified end-to-end: a dockerized rtw workspace create --disable-testing runs
    colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF.

Build the initial colcon build with -DBUILD_TESTING=OFF so workspace
creation still completes when a source dependency builds but its tests
do not. Defaults to off, preserving current behaviour.

Signed-off-by: Matthias Schoepfer <matthias.schoepfer@googlemail.com>
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