Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a utility for spawning subprocesses #98

Merged
merged 5 commits into from
Jul 17, 2023
Merged

Conversation

mjcarroll
Copy link
Contributor

🎉 New feature

Summary

This includes the unlicensed header-only subprocess.h from https://github.com/sheredom/subprocess.h

This gives a uniform, cross-platform way of spawning executables and interacting with them from a C++ application. Importantly, it allows for reading both cout and cerr.

The intention is to use this to remove any custom executable calling that we have throughout the remainder of the Gazebo stack.

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Michael Carroll <[email protected]>
@mjcarroll mjcarroll requested a review from azeey as a code owner June 27, 2023 18:53
@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #98 (eed4bd2) into gz-utils2 (135a6f6) will decrease coverage by 12.52%.
The diff coverage is 70.61%.

❗ Current head eed4bd2 differs from pull request most recent head 99926b7. Consider uploading reports for the commit 99926b7 to get more accurate results

@@              Coverage Diff               @@
##           gz-utils2      #98       +/-   ##
==============================================
- Coverage      91.97%   79.45%   -12.52%     
==============================================
  Files              6        8        +2     
  Lines            137      331      +194     
==============================================
+ Hits             126      263      +137     
- Misses            11       68       +57     
Impacted Files Coverage Δ
include/gz/utils/detail/subprocess.h 59.25% <59.25%> (ø)
include/gz/utils/Subprocess.hh 96.61% <96.61%> (ø)

Signed-off-by: Michael Carroll <[email protected]>
include/gz/utils/Subprocess.hh Outdated Show resolved Hide resolved
test/integration/CMakeLists.txt Outdated Show resolved Hide resolved
test/integration/CMakeLists.txt Outdated Show resolved Hide resolved
test/integration/subprocess_TEST.cc Outdated Show resolved Hide resolved
include/gz/utils/Subprocess.hh Outdated Show resolved Hide resolved
include/gz/utils/Subprocess.hh Outdated Show resolved Hide resolved
include/gz/utils/Subprocess.hh Show resolved Hide resolved
test/integration/subprocess_TEST.cc Outdated Show resolved Hide resolved
test/integration/subprocess_TEST.cc Outdated Show resolved Hide resolved
Signed-off-by: Michael Carroll <[email protected]>
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small comment

Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
@mjcarroll mjcarroll merged commit 9bd589a into gz-utils2 Jul 17, 2023
5 of 8 checks passed
@mjcarroll mjcarroll deleted the mjcarroll/subprocess branch July 17, 2023 18:19
mjcarroll added a commit that referenced this pull request Jul 25, 2023
Signed-off-by: Michael Carroll <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants