Skip to content

Commit

Permalink
Merge branch 'gz-transport12' into 12_to_13
Browse files Browse the repository at this point in the history
  • Loading branch information
caguero committed Jan 26, 2024
2 parents 764a04b + 92d02dc commit a90099a
Show file tree
Hide file tree
Showing 58 changed files with 1,076 additions and 1,196 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
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 }}

131 changes: 131 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
load(
"@gz//bazel/lint:lint.bzl",
"add_lint_tests",
)

package(
default_visibility = GZ_VISIBILITY,
features = GZ_FEATURES,
)

licenses(["notice"]) # Apache-2.0

exports_files(["LICENSE"])

gz_configure_header(
name = "transport_config_hh",
src = "include/gz/transport/config.hh.in",
cmakelists = ["CMakeLists.txt"],
package = "transport",
)

gz_export_header(
name = "include/gz/transport/Export.hh",
export_base = "GZ_TRANSPORT",
lib_name = "gz-transport",
visibility = ["//visibility:private"],
)

public_headers_no_gen = glob([
"include/gz/transport/*.h",
"include/gz/transport/*.hh",
"include/gz/transport/detail/*.hh",
])

private_headers = glob(["src/*.hh"])

sources = glob(
["src/*.cc"],
exclude = [
"src/*_TEST.cc",
],
)

gz_include_header(
name = "transport_hh_genrule",
out = "include/gz/transport.hh",
hdrs = public_headers_no_gen + [
"include/gz/transport/config.hh",
"include/gz/transport/Export.hh",
],
)

public_headers = public_headers_no_gen + [
"include/gz/transport/config.hh",
"include/gz/transport/Export.hh",
"include/gz/transport.hh",
]

cc_library(
name = "transport",
srcs = sources + private_headers,
hdrs = public_headers,
copts = [
"-Wno-deprecated-declarations",
],
includes = ["include"],
deps = [
GZ_ROOT + "msgs",
"@uuid",
"@zmq",
],
)

cc_binary(
name = "topic",
srcs = [
"src/cmd/gz.cc",
"src/cmd/gz.hh",
"src/cmd/topic_main.cc",
],
includes = ["src/cmd"],
deps = [
":transport",
GZ_ROOT + "utils/cli",
],
)

cc_binary(
name = "service",
srcs = [
"src/cmd/gz.cc",
"src/cmd/gz.hh",
"src/cmd/service_main.cc",
],
includes = ["src/cmd"],
deps = [
":transport",
GZ_ROOT + "utils/cli",
],
)

test_sources = glob(
include = ["src/*_TEST.cc"],
)

[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
env = {
"GZ_BAZEL": "1",
"GZ_BAZEL_PATH": "transport",
},
deps = [
":transport",
GZ_ROOT + "common/testing",
GZ_ROOT + "transport/test:utils",
"@gtest",
"@gtest//:gtest_main",
],
) for src in test_sources]

add_lint_tests()
55 changes: 55 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,33 @@

## Gazebo Transport 11.X

### Gazebo Transport 11.4.1 (2023-09-01)

1. Fix topic/service list inconsistency
* [Pull request #415](https://github.com/gazebosim/gz-transport/pull/415)

1. Backport Windows fix to ign-transport8
* [Pull request #406](https://github.com/gazebosim/gz-transport/pull/406)

1. Fix unused-result warning
* [Pull request #408](https://github.com/gazebosim/gz-transport/pull/408)

1. Fix compatibility with protobuf 22
* [Pull request #405](https://github.com/gazebosim/gz-transport/pull/405)

1. Fix compiler warning and signedness issue
* [Pull request #401](https://github.com/gazebosim/gz-transport/pull/401)

1. Rename COPYING to LICENSE
* [Pull request #392](https://github.com/gazebosim/gz-transport/pull/392)

1. Infrastructure
* [Pull request #391](https://github.com/gazebosim/gz-transport/pull/391)
* [Pull request #394](https://github.com/gazebosim/gz-transport/pull/394)

1. Support clang and std::filesystem
* [Pull request #390](https://github.com/gazebosim/gz-transport/pull/390)

### Gazebo Transport 11.4.0 (2023-03-08)

1. Added Node::RequestRaw
Expand Down Expand Up @@ -461,6 +488,34 @@
and publication, age, and reception statistics.
* [Pull request 205](https://github.com/gazebosim/gz-transport/pull/205)

### Gazebo Transport 8.5.0 (2024-01-05)

1. Update github action workflows
* [Pull request #460](https://github.com/gazebosim/gz-transport/pull/460)
* [Pull request #391](https://github.com/gazebosim/gz-transport/pull/391)
* [Pull request #392](https://github.com/gazebosim/gz-transport/pull/392)

1. Adds the subcommands for the log command
* [Pull request #451](https://github.com/gazebosim/gz-transport/pull/451)

1. Fix topic/service list inconsistency
* [Pull request #415](https://github.com/gazebosim/gz-transport/pull/415)

1. Backport Windows fix to ign-transport8
* [Pull request #406](https://github.com/gazebosim/gz-transport/pull/406)

1. Fix compatibility with protobuf 22
* [Pull request #405](https://github.com/gazebosim/gz-transport/pull/405)

1. Fix compiler warning and signedness issue
* [Pull request #401](https://github.com/gazebosim/gz-transport/pull/401)

1. Support clang and std::filesystem
* [Pull request #390](https://github.com/gazebosim/gz-transport/pull/390)

1. Pass std::function by value to Node::Subscribe
* [Pull request #382](https://github.com/gazebosim/gz-transport/pull/382)

### Gazebo Transport 8.4.0 (2022-11-17)

1. ign -> gz : Remove redundant namespace references.
Expand Down
91 changes: 91 additions & 0 deletions log/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"cmake_configure_file",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
load(
"@gz//bazel/lint:lint.bzl",
"add_lint_tests",
)

cmake_configure_file(
name = "build_config",
src = "src/build_config.hh.in",
out = "include/build_config.hh",
cmakelists = ["src/CMakeLists.txt"],
defines = [
"SCHEMA_INSTALL_PATH=transport/log/sql",
],
)

gz_export_header(
name = "include/gz/transport/log/Export.hh",
export_base = "GZ_TRANSPORT_LOG",
lib_name = "gz-transport-log",
visibility = ["//visibility:private"],
)

public_headers_no_gen = glob([
"include/gz/transport/log/*.hh",
"include/gz/transport/log/detail/*.hh",
])

private_headers = glob(["src/*.hh"])

sources = glob(
["src/*.cc"],
exclude = [
"src/*_TEST.cc",
],
)

public_headers = public_headers_no_gen + [
"include/gz/transport/log/Export.hh",
]

cc_library(
name = "log",
srcs = sources + private_headers + ["include/build_config.hh"],
hdrs = public_headers,
data = ["sql/0.1.0.sql"],
includes = ["include"],
deps = [
GZ_ROOT + "transport",
"@sqlite3",
],
)

test_sources = glob(
include = ["src/*_TEST.cc"],
exclude = ["src/LogCommandAPI_TEST.cc"],
)

[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
data = [
"test/data/state.tlog",
],
defines = [
'GZ_TRANSPORT_LOG_TEST_PATH=\\"transport/log/test\\"',
'CORRUPT_DB_TEST_PATH=\\"transport/log/test/data/state.tlog\\"',
],
env = {
"GZ_BAZEL": "1",
"GZ_BAZEL_PATH": "transport",
},
deps = [
":log",
GZ_ROOT + "common/testing",
GZ_ROOT + "transport/test:utils",
"@gtest",
"@gtest//:gtest_main",
],
) for src in test_sources]

add_lint_tests()
11 changes: 5 additions & 6 deletions log/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ endif()
gz_build_tests(
TYPE "UNIT"
SOURCES ${gtest_sources}
LIB_DEPS ${log_lib_target} ${EXTRA_TEST_LIB_DEPS}
LIB_DEPS ${log_lib_target} ${EXTRA_TEST_LIB_DEPS} test_config
TEST_LIST logging_tests
)

foreach(test_target ${logging_tests})

set_tests_properties(${logging_tests} PROPERTIES
set_tests_properties(${test_target} PROPERTIES
ENVIRONMENT GZ_TRANSPORT_LOG_SQL_PATH=${PROJECT_SOURCE_DIR}/log/sql)
target_compile_definitions(${test_target} PRIVATE
"CORRUPT_DB_TEST_PATH=\"${CMAKE_SOURCE_DIR}/log/test/data/state.tlog\""
)

endforeach()

Expand All @@ -46,9 +48,6 @@ install(DIRECTORY ../sql DESTINATION ${SCHEMA_INSTALL_BASE})
set(SCHEMA_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${SCHEMA_INSTALL_BASE}/sql)
configure_file(build_config.hh.in build_config.hh @ONLY)


message(STATUS "CMAKE_CURRENT_SOURCE_DIR:${CMAKE_CURRENT_SOURCE_DIR}")

target_include_directories(${log_lib_target}
PUBLIC
# Add this component's include directory to the build interface include
Expand Down
15 changes: 8 additions & 7 deletions log/src/Log_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,25 @@
* limitations under the License.
*
*/
#include "gtest/gtest.h"

#include <chrono>
#include <ios>
#include <string>
#include <unordered_set>

#include "gz/transport/log/Log.hh"
#include "test_config.hh"
#include "log/test_config.hh"
#include "gtest/gtest.h"

#include "test_utils.hh"

using namespace gz;
using namespace gz::transport;
using namespace std::chrono_literals;

namespace {
constexpr const char * kCorruptDbTestPath = CORRUPT_DB_TEST_PATH;
}

//////////////////////////////////////////////////
TEST(Log, OpenMemoryDatabase)
{
Expand Down Expand Up @@ -251,10 +255,7 @@ TEST(Log, NullDescriptorUnopenedLog)
TEST(Log, OpenCorruptDatabase)
{
log::Log logFile;
std::string path =
testing::portablePathUnion(GZ_TRANSPORT_LOG_TEST_PATH, "data");
path = testing::portablePathUnion(path, "state.tlog");
logFile.Open(path);
logFile.Open(kCorruptDbTestPath);
EXPECT_GT(logFile.EndTime(), 0ns) << "logFile.EndTime() == "
<< logFile.EndTime().count() << "ns";;
}
4 changes: 0 additions & 4 deletions log/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
configure_file (test_config.hh.in
${PROJECT_BINARY_DIR}/include/log/test_config.hh
)

add_subdirectory(integration)
Loading

0 comments on commit a90099a

Please sign in to comment.