apache / celix

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.
https://celix.apache.org/
Apache License 2.0
167 stars 88 forks source link

[WIP] Feature/cap req model lib #518

Closed pnoltes closed 1 year ago

pnoltes commented 1 year ago

This pull request adds a basic implementation of the requirement-capability model in a static Celix::rcm library.

This is the first task of #511. Future work on #511 will probably be done much later, but I think this pull request is good to review now for the following:

Also good to note is that thanks due to the celix error injection setup, the added code has a test coverage of almost 100% :smile: . Only 2 lines have no coverage yet and that is due to a TBD about whether we want a Celix abstraction for thread specific storage. If that is decided a celix ei for the chosen thread specific storage can be added.

codecov-commenter commented 1 year ago

Codecov Report

Merging #518 (d0d1ab3) into master (94d06c4) will increase coverage by 0.39%. The diff coverage is 98.82%.

:exclamation: Current head d0d1ab3 differs from pull request most recent head bf4fbc2. Consider uploading reports for the commit bf4fbc2 to get more accurate results

@@            Coverage Diff             @@
##           master     #518      +/-   ##
==========================================
+ Coverage   75.57%   75.97%   +0.39%     
==========================================
  Files         225      229       +4     
  Lines       34445    34760     +315     
==========================================
+ Hits        26033    26408     +375     
+ Misses       8412     8352      -60     
Impacted Files Coverage Δ
libs/utils/src/array_list.c 89.45% <93.33%> (+0.18%) :arrow_up:
libs/rcm/src/celix_rcm_err.c 96.66% <96.66%> (ø)
libs/rcm/src/celix_capability.c 100.00% <100.00%> (ø)
libs/rcm/src/celix_requirement.c 100.00% <100.00%> (ø)
libs/rcm/src/celix_resource.c 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

pnoltes commented 1 year ago

Nice use of error injector! My experience tells that 95% coverage usually implies high quality. Hopefully we can gradually achieve that level for the whole project.

I have not finished reviewing this PR, but I do have some remarks. Given that work has not been finished, what about we merge Err first and use it to solve #503?

Sure. Give me some time to spit the err in a separate lib or add it to utils.

PengZheng commented 1 year ago

Please note that #531 raised the issue of sharing the same set of directives and attributes between multiple capabilities. We may need to address it in our new implementation.

pnoltes commented 1 year ago

I will extract the celix_err.c and error injection changes to a separate PR.