diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 715d7cd..632a792 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@ name: Ubuntu CI -on: [push, pull_request] +on: + pull_request: + push: + branches: + - 'ign-utils[0-9]' + - 'gz-utils[0-9]' + - 'main' jobs: jammy-ci: diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 2c94852..2332244 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -14,4 +14,3 @@ jobs: with: project-url: https://github.com/orgs/gazebosim/projects/7 github-token: ${{ secrets.TRIAGE_TOKEN }} - diff --git a/BUILD.bazel b/BUILD.bazel index cafd9c2..435829a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -41,6 +41,7 @@ gz_export_header( public_headers_no_gen = glob([ "include/gz/utils/*.hh", "include/gz/utils/detail/*.hh", + "include/gz/utils/detail/*.h", ]) gz_include_header( @@ -110,3 +111,23 @@ cc_test( "@gtest//:gtest_main", ], ) + +cc_binary( + name = "subprocess_main", + srcs = ["test/integration/subprocess/subprocess_main.cc"], + deps = [ + GZ_ROOT + "utils/cli", + ] +) + +cc_test( + name = "subprocess_TEST", + srcs = ["test/integration/subprocess_TEST.cc"], + deps = [ + ":utils", + ":subprocess_main", + "@gtest", + "@gtest//:gtest_main", + ], + local_defines = ['SUBPROCESS_EXECUTABLE_PATH=\\"utils/subprocess_main\\"'], +) diff --git a/README.md b/README.md index 09c724f..6d35df2 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Build | Status -- | -- Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-utils) -Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_utils-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_utils-ci-main-focal-amd64) -Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_utils-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_utils-ci-main-homebrew-amd64) -Windows | [![Build Status](https://build.osrfoundation.org/job/ign_utils-ci-win/badge/icon)](https://build.osrfoundation.org/job/ign_utils-ci-win/) +Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_utils-ci-main-jammy-amd64)](https://build.osrfoundation.org/job/gz_utils-ci-main-jammy-amd64) +Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_utils-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/gz_utils-ci-main-homebrew-amd64) +Windows | [![Build Status](https://build.osrfoundation.org/job/gz_utils-main-win/badge/icon)](https://build.osrfoundation.org/job/ign_utils-ci-win/) Gazebo Utils, a component of [Gazebo](https://gazebosim.org), provides general purpose classes and functions designed for robotic applications. diff --git a/include/gz/utils/detail/subprocess.h b/include/gz/utils/detail/subprocess.h index 7077ffe..137aa14 100644 --- a/include/gz/utils/detail/subprocess.h +++ b/include/gz/utils/detail/subprocess.h @@ -187,7 +187,7 @@ subprocess_weak int subprocess_terminate(struct subprocess_s *const process); /// /// The only safe way to read from the standard output of a process during it's /// execution is to use the `subprocess_option_enable_async` option in -/// conjuction with this method. +/// conjunction with this method. subprocess_weak unsigned subprocess_read_stdout(struct subprocess_s *const process, char *const buffer, unsigned size); @@ -201,7 +201,7 @@ subprocess_read_stdout(struct subprocess_s *const process, char *const buffer, /// /// The only safe way to read from the standard error of a process during it's /// execution is to use the `subprocess_option_enable_async` option in -/// conjuction with this method. +/// conjunction with this method. subprocess_weak unsigned subprocess_read_stderr(struct subprocess_s *const process, char *const buffer, unsigned size); diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..5764bbf --- /dev/null +++ b/package.xml @@ -0,0 +1,19 @@ + + + gz-utils3 + 3.0.0 + Gazebo Utils : Classes and functions for robot applications + + Addizu Z. Taddese + Apache License 2.0 + + https://github.com/gazebosim/gz-utils + + cmake + + gz-cmake4 + + + cmake + + diff --git a/src/Environment.cc b/src/Environment.cc index d477414..7daace5 100644 --- a/src/Environment.cc +++ b/src/Environment.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #ifdef _WIN32 @@ -189,7 +190,9 @@ EnvironmentStrings envMapToStrings(const EnvironmentMap &_envMap) std::sort(sorted.begin(), sorted.end()); for (auto [key, value] : sorted) { - ret.push_back(key + "=" + value); + key += '='; + key += value; + ret.push_back(key); } return ret; }