Skip to content

Commit

Permalink
Merge pull request #130 from gazebosim/scpeters/merge_2_main
Browse files Browse the repository at this point in the history
Merge gz-utils2 ➡️  main
  • Loading branch information
azeey authored May 6, 2024
2 parents d9456d6 + aed266a commit b62b30a
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

21 changes: 21 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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\\"'],
)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions include/gz/utils/detail/subprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
19 changes: 19 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<package format="2">
<name>gz-utils3</name>
<version>3.0.0</version>
<description>Gazebo Utils : Classes and functions for robot applications</description>

<maintainer email="[email protected]">Addizu Z. Taddese</maintainer>
<license>Apache License 2.0</license>

<url type="website">https://github.com/gazebosim/gz-utils</url>

<buildtool_depend>cmake</buildtool_depend>

<build_depend>gz-cmake4</build_depend>

<export>
<build_type>cmake</build_type>
</export>
</package>
5 changes: 4 additions & 1 deletion src/Environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <algorithm>
#include <cstdlib>
#include <string>
#include <utility>
#include <vector>

#ifdef _WIN32
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b62b30a

Please sign in to comment.