The following describes the mapping of some
ament_tools options and arguments to the
colcon command line interface.
ament build | test¶
- CMake configures tests by default.
To skip configuring tests use
- The colcon option
--merge-installhas the inverse logic.
--only-packages PKGNAME1 ... PKGNAMEn
--packages-select PKGNAME1 ... PKGNAMEn
--skip-packages PKGNAME1 ... PKGNAMEn
--packages-skip PKGNAME1 ... PKGNAMEn
- colcon uses the parallel execution by default.
To build packages sequentially use
colcon build ...
--cmake-args -D... --
--cmake-args " -D..."Any CMake arguments which start with a dash need to be prefixed with a space. This can be done by quoting each argument with a leading space. The closing double dash is not necessary anymore.
--cmake-args " -G" NinjaSee
--cmake-argsfor the reason for the quoting and prefixed space.
colcon test ...
--ctest-args ... --
--ctest-args ...Any CTest arguments which start with a dash need to be prefixed with a space (see
colcon test-result ...
test verb performs only the action of running tests.
It does not build any packages.
colcon uses pytest-repeat which runs individual tests of a package N+1 times each (the first test N+1 times, then the second test N+1 times, etc).
ament_tools the entire test suite of a package was run up to N+1 times.
As a consequence
colcon provides a more accurate result since each test that passed has actually run N times.
Note that with
pytest tests are repeated N times regardless of the result of the previous runs; if a test fails it will be repeated N times anyway.
This is different from the behavior of a CTest test that will stop being repeated as soon as it fails once.
The location of JUnit test results file for
ament_python packages tested with
colcon is in
<pkg-build>/pytest.xml, whereas with
ament_tools it is in