Commit graph

15 commits

Author SHA1 Message Date
brawner
b62b83b5cd Add mocking unit tests for rcl_yaml_param_parser (coverage part 3/3) (#772)
* Add mocking unit tests for rcl_yaml

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* deallocate test_path

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Fix memory leaks

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-09 09:02:32 +02:00
brawner
08bbdde860 Add fault-injection unit tests (coverage part 2/3) (#766)
* Fault injection tests for rcl_yaml

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Pause fault injection

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* variant_copy

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-09 09:02:32 +02:00
brawner
79e2e044d3 Add basic unit tests for refactored functions in rcl_yaml_param_parser (coverage part 1/3) (#771)
* Add basic unit tests for refactored functions

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Fix memory errors

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* headers moved

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Addressing feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Switch to decltype

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-09 09:02:32 +02:00
ahcorde
bba14e9318 Removed variant benchmark
Signed-off-by: ahcorde <ahcorde@gmail.com>
2020-10-08 08:45:33 +02:00
Alejandro Hernández Cordero
1c08083888 Added benchmark test to rcl_yaml_param_parser (#803)
* Added benchmark test to rcl_yaml_param_parser

Signed-off-by: ahcorde <ahcorde@gmail.com>

* reset heap counters

Signed-off-by: ahcorde <ahcorde@gmail.com>

* updated benchmark tests

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Added feedback

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Replace BENCHMARK_DEFINE_F and BENCHMARK_REGISTER_F with BENCHMARK_F

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Used rcpputils for the path

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Clean up the CMake dependencies

Signed-off-by: Scott K Logan <logans@cottsay.net>

* Updated test

Signed-off-by: ahcorde <ahcorde@gmail.com>

* udpated test name

Signed-off-by: ahcorde <ahcorde@gmail.com>

Co-authored-by: Scott K Logan <logans@cottsay.net>
2020-10-08 08:45:33 +02:00
brawner
2c513aa0ed
[foxy backport] Refactor parser.c for better testability (#754) (#784)
* Refactor parser.c for better testability (#754)

* Refactor rcl_yaml_param_parser for better testability

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Reorder parser.c to match parser.h

Signed-off-by: Stephen Brawner <brawner@gmail.com>

squash! Reorder parser.c to match parser.h

* Refactor yaml_variant.c for deduplication

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* ADD_VALUE_TO_SIMPLE_ARRAY for deduplication

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Remove fprintf

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Move headers to src directory

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Rebase #780

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Missing includes

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-05 18:01:07 -07:00
brawner
65c2d46ee0
Increase rcl_yaml_param_parser test coverage (#656)
* Cleanup and address issues in parser.c

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

squash! Cleanup and address issues in parser.c

* Increase test coverage of parser

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* PR Fixup

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

* PR Fixup

Signed-off-by: Stephen Brawner <stephenbrawner@verbsurgical.com>

Co-authored-by: Stephen Brawner <stephenbrawner@verbsurgical.com>
2020-05-26 12:45:36 -07:00
Dirk Thomas
3d1337d0fc
fix usage to not expose underlying yaml (#630)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-04-22 15:14:47 -07:00
Dirk Thomas
0a795cc776
export targets in a addition to include directories / libraries (#621)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-04-20 09:33:04 -07:00
Dirk Thomas
918dd5a4d3
remove usage of undefined CMake variable (#620)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-04-17 12:48:32 -07:00
Dan Rose
c1739354b1 Specify test working directory (#529)
Avert breakage from https://github.com/ament/ament_cmake/pull/206
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-23 13:40:43 -07:00
Michel Hidalgo
5fde9c0c0e
[YAML Parser] Support parameter value parsing (#471)
* Support parameter YAML string value parsing.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Address peer review comments.

- Improve test coverage using new getter API.
- Unify function return style and improve readability.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Clean up allocations in rcl_yaml_param_parser package tests.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2019-07-12 15:07:42 -03:00
Michel Hidalgo
f9ceef5c86
[YAML Parser] Depend on rcutils only (#470)
* Make rcl_yaml_param_parser depend on rcutils only.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Address peer review comments.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
2019-07-12 11:01:24 -03:00
Sachin Suresh Bhat
2ff5df0c11 Set symbol visibility to hidden for rcl (#391)
* Set symbol visibility to hidden for rcl

Enabling symbol visibility feature in gcc and clang compilers.
This will hep find symbol export related issues in linux and
potentially reduce compile times.

Discourse topic link:
https://discourse.ros.org/t/set-symbol-visibility-to-hidden-for-rmw-and-rcl-packages/7981

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Remove WIN specific compiler definition in configure_rcl

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Rename macro name rcl_set_symbol_visibility_hidden

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Change macro to args for rcl_set_symbol_visibility_hidden

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>
2019-03-05 18:09:55 -08:00
anup-pem
5edf27b032 YAML parameter parser (#235)
* Implement a basic YAML based parameter parser for ros2 nodes

* Add README file

* Fix the issues after moving from rcutils_yaml_param_parser to rcl_yaml_param_parser

  - rename folders from rcutils_yaml_param_parser to rcl_yaml_param_parser
  - rename project, header guards and include statements from rcutils_yaml_param_parser to rcl_yaml_param_parser
  - move type declaration in separat file and namespace new structures
  - Fix the code review comments from Mikael

* Few minor changes

   - Changed "params" string to "ros__parameters"
   - Add -Wall, -Wextra and -Wpedantic falgs
   - Fix the compile warning with the new flags

* Fix the changes made in the design of C structure

  - Remove the node_namespaces entry in rcl_params_t
  - Change the type of num_nodes and num_params to size_t

* depend on libyaml_vendor (#236)

* Fix cmake setting standard(C and C++) and add byte_array in C struct

*   Remove C11 so that it defaults to C99

* [rcl_yaml_param_parser] fix export symbols (#237)

* add visibility macros

* remove unused macro

* Support for multi level node and parameter name spaces

* Additional fixes and cleanups

  - Support for string namespace seperator
  - Provide parameter structure init function API
  - name cleanups

* off by 1

* Call yaml_parser_delete()

* fclose(yaml_file)

* free() allocated paths

* Call yaml_event_delete()

* completely deallcoate string array

* Few cleanup changes

  - Add install command into CMakelists.txt
  - Replace one of the zero_allocate with reallocate
  - Pass allocator state
  - Fix int32_t -> rcl_ret_t return value

* Don't include unistd.h

* Use size_t for array indices

* Just pass the allocator in the init function
2018-05-29 18:07:02 +02:00