Skip to content

Commit

Permalink
rename test utils to autoware test utils
Browse files Browse the repository at this point in the history
Signed-off-by: Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 committed Jun 3, 2024
1 parent fbe43f1 commit 4080550
Show file tree
Hide file tree
Showing 45 changed files with 43,098 additions and 164 deletions.
2 changes: 1 addition & 1 deletion common/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ nav:
- 'Testing Libraries':
- 'autoware_testing': common/autoware_testing/design/autoware_testing-design
- 'fake_test_node': common/fake_test_node/design/fake_test_node-design
- 'Test Utils': common/test_utils
- 'Test Utils': common/autoware_test_utils
- 'Common Libraries':
- 'autoware_auto_common':
- 'comparisons': common/autoware_auto_common/design/comparisons
Expand Down
29 changes: 29 additions & 0 deletions common/autoware_test_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_test_utils)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(autoware_test_utils SHARED
src/autoware_test_utils.cpp)

ament_auto_add_library(mock_data_parser SHARED
src/mock_data_parser.cpp)

target_link_libraries(mock_data_parser
yaml-cpp
)

if(BUILD_TESTING)
ament_add_ros_isolated_gtest(test_mock_data_parser
test/test_mock_data_parser.cpp)

target_link_libraries(test_mock_data_parser
mock_data_parser)
endif()

ament_auto_package(INSTALL_TO_SHARE
config
test_map
test_data
)
40 changes: 40 additions & 0 deletions common/autoware_test_utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Test Utils

## Background

Several Autoware's components and modules have already adopted unit testing, so a common library to ease the process of writing unit tests is necessary.

## Purpose

The objective of the `test_utils` is to develop a unit testing library for the Autoware components. This library will include

- commonly used functions
- input/mock data parser
- maps for testing
- common routes and mock data for testing.

## Available Maps

The following maps are available [here](https://github.com/autowarefoundation/autoware.universe/tree/main/planning/test_utils/test_map)

### Common

The common map contains multiple types of usable inputs, including shoulder lanes, intersections, and some regulatory elements. The common map is named `lanelet2_map.osm` in the folder.

![common](./images/common.png)

### 2 km Straight

The 2 km straight lanelet map consists of two lanes that run in the same direction. The map is named `2km_test.osm`.

![two_km](./images/2km-test.png)

The following illustrates the design of the map.

![straight_diagram](./images/2km-test.svg)

## Example use cases

### Autoware Planning Test Manager

The goal of the [Autoware Planning Test Manager](https://autowarefoundation.github.io/autoware.universe/main/planning/autoware_planning_test_manager/) is to test planning module nodes. The `PlanningInterfaceTestManager` class ([source code](https://github.com/autowarefoundation/autoware.universe/blob/main/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp)) creates wrapper functions based on the `test_utils` functions.
Loading

0 comments on commit 4080550

Please sign in to comment.