Add --disable-testing flag to workspace create - #318
Open
DasRoteSkelett wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
--disable-testingflag tortw workspace create. When set, the initialcolcon buildis run with-DBUILD_TESTING=OFF, so test targets are not compiled.Defaults to off — existing behaviour is unchanged.
Motivation
rtw workspace createruns an initialcolcon buildafter importing the sources.With
BUILD_TESTINGon (the ament default), that build also compiles every package'stest 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-testinglets creation complete in that case without hand-editing theimported tree.
colcon builddoes not run tests; this only skips compiling them.Changes
workspace_utils.get_compile_cmd()gains adisable_testingparameter that appends-DBUILD_TESTING=OFFto thecolcon build --cmake-args.rtw workspace creategains the--disable-testingflag, threaded to every compileinvocation (main and upstream workspace).
docs/rtwcli/index.rst.Testing
rtw workspace create --helplists--disable-testing.get_compile_cmd(..., disable_testing=True)emits--cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF; the defaultemits only
-DCMAKE_BUILD_TYPE=RelWithDebInfo.rtw workspace create --disable-testingrunscolcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF.