Giter Club home page Giter Club logo

Comments (4)

ijnek avatar ijnek commented on July 21, 2024

Setting -DBUILD_TESTING=OFF would prevent CMake from building anything inside:

if (BUILD_TESTING)
   # Testing code
endif()

colcon build is a utility to help you build your package in your workspace in order, using information purely from package.xml, it won't consider anything passed by the cmake-args (and it doesn't make sense to).

You should be able to use --packages-skip ament_cmake_test ament_cmake_gtest to achieve what you want.

I'm not sure if there is a colcon flag that skips all "test_depend" dependencies without explicitly listing them, but if there isn't one that would sound like a good addition to colcon-core to me.

from colcon-core.

mikepurvis avatar mikepurvis commented on July 21, 2024

I'm not sure if there is a colcon flag that skips all "test_depend" dependencies without explicitly listing them, but if there isn't one that would sound like a good addition to colcon-core to me.

Colcon's package discovery crushes down test depends to be build depends currently; it would be a pretty major design shift for colcon to begin recognizing tests more explicitly.

from colcon-core.

cottsay avatar cottsay commented on July 21, 2024

Colcon's package discovery crushes down test depends to be build depends currently; it would be a pretty major design shift for colcon to begin recognizing tests more explicitly.

I'm not sure this is accurate. Part of the issue is that not all package formats support discriminating between dependency types at all, and some just lack consistency in how to do it (looking at you, Python).

For example, for packages which use package.xml, the test dependencies are already enumerated separately. The issue is that the build verb implicitly considers all enumerated dependencies, regardless of type, to be build-time dependencies of the package:

if categories is None:
categories = self.dependencies.keys()

from colcon-core.

razr avatar razr commented on July 21, 2024

a colcon flag that skips all "test_depend" dependencies without explicitly listing them

@ijnek I think this is exactly what I was looking for. Another way might be to prepend

if (BUILD_TESTING)
# CMakeLists content of the test package
endif()

to all test packages?

from colcon-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.