Skip to content

Commit

Permalink
Add how to run unit tests (#171)
Browse files Browse the repository at this point in the history
Add how to rebuild a package, how to run unit tests, and how to limit directories to run unit tests
tier4/autoware.iv#1545 tier4/autoware.iv#1924
  • Loading branch information
IshitaTakeshi authored Sep 2, 2021
1 parent 694fc43 commit 2c8517d
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/developer_guide/UnitTestGuideline.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# TierIV Unit Test Guideline

See [confluence page](https://tier4.atlassian.net/wiki/spaces/AIP/pages/1400045921/T4)
## How to run unit tests

You may modify the code before running unit tests. This is how to rebuild the package you modified.

```sh
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to <package name>
```

`package name` must be the name of a package that contains package.xml

Use the commands below to run unit tests. `--packages-skip-test-passed` can be used to ignore test cases that already passed.

```sh
source install/setup.bash
colcon test --event-handlers console_cohesion+ --packages-skip-test-passed
```

If you would like to run unit tests in a specific directory, you can use the `--base-paths` option. For example, if you would like to run unit tests in autoware.iv, you can run

```sh
colcon test --event-handlers console_cohesion+ --base-paths src/autoware/autoware.iv --packages-skip-test-passed
```

## How to write unit tests

See [confluence page](https://tier4.atlassian.net/wiki/spaces/AIP/pages/1400045921/T4) for the details.

0 comments on commit 2c8517d

Please sign in to comment.