From 4bb6e0d079506d221490bed5e515dfb40eb4cb85 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 23 Apr 2024 11:12:29 -0500 Subject: [PATCH] Add package.xml (#432) * Fix windows tests * Disable bash completion test on windows Signed-off-by: Addisu Z. Taddese --- .github/workflows/package_xml.yml | 11 +++++++++++ core/src/cmd/CMakeLists.txt | 8 +++++++- core/src/cmd/cmdmsgs.rb.in | 10 +++++++++- package.xml | 26 ++++++++++++++++++++++++++ test/integration/gz_TEST.cc | 3 ++- 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/package_xml.yml create mode 100644 package.xml diff --git a/.github/workflows/package_xml.yml b/.github/workflows/package_xml.yml new file mode 100644 index 00000000..4bd4a9aa --- /dev/null +++ b/.github/workflows/package_xml.yml @@ -0,0 +1,11 @@ +name: Validate package.xml + +on: + pull_request: + +jobs: + package-xml: + runs-on: ubuntu-latest + name: Validate package.xml + steps: + - uses: gazebo-tooling/action-gz-ci/validate_package_xml@jammy diff --git a/core/src/cmd/CMakeLists.txt b/core/src/cmd/CMakeLists.txt index dabee188..44a0ed2e 100644 --- a/core/src/cmd/CMakeLists.txt +++ b/core/src/cmd/CMakeLists.txt @@ -31,7 +31,13 @@ set(cmd_script_configured "${CMAKE_CURRENT_BINARY_DIR}/cmd${GZ_DESIGNATION}${PRO # Set the library_location variable to the relative path to the library file # within the install directory structure. -set(library_location "../../../${CMAKE_INSTALL_LIBDIR}/$") +if (MSVC) + set(library_location_prefix "${CMAKE_INSTALL_BINDIR}") +else() + set(library_location_prefix "${CMAKE_INSTALL_LIBDIR}") +endif() + +set(library_location "../../../${library_location_prefix}/$") configure_file( "cmd${GZ_DESIGNATION}.rb.in" diff --git a/core/src/cmd/cmdmsgs.rb.in b/core/src/cmd/cmdmsgs.rb.in index ffb9829c..a2917e3d 100644 --- a/core/src/cmd/cmdmsgs.rb.in +++ b/core/src/cmd/cmdmsgs.rb.in @@ -26,6 +26,7 @@ else end require 'optparse' +require 'pathname' # Constants. LIBRARY_NAME = '@library_location@' @@ -101,7 +102,7 @@ class Cmd # puts options # Read the plugin that handles the command. - if LIBRARY_NAME[0] == '/' + if Pathname.new(LIBRARY_NAME).absolute? # If the first character is a slash, we'll assume that we've been given an # absolute path to the library. This is only used during test mode. plugin = LIBRARY_NAME @@ -112,6 +113,13 @@ class Cmd end conf_version = LIBRARY_VERSION + if defined? RubyInstaller + # RubyInstaller does not search for dlls in PATH or the directory that tests are running from, + # so we'll add the parent directory of the plugin to the search path. + # https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#-dll-loading + RubyInstaller::Runtime.add_dll_directory(File.dirname(plugin)) + end + begin Importer.dlload plugin rescue DLError diff --git a/package.xml b/package.xml new file mode 100644 index 00000000..1e17e9fc --- /dev/null +++ b/package.xml @@ -0,0 +1,26 @@ + + + gz-msgs10 + 10.1.2 + Gazebo Messages: Protobuf messages and functions for robot applications + Carlos Agüero + Apache License 2.0 + https://github.com/gazebosim/gz-msgs + + cmake + + gz-cmake3 + + gz-math7 + gz-tools2 + protobuf-dev + python3-protobuf + python3 + tinyxml2 + + python3-pytest + + + cmake + + diff --git a/test/integration/gz_TEST.cc b/test/integration/gz_TEST.cc index 993ff562..c99f900f 100644 --- a/test/integration/gz_TEST.cc +++ b/test/integration/gz_TEST.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include "test_config.hh" #ifdef _MSC_VER @@ -95,7 +96,7 @@ TEST(CmdLine, MsgInfo) } ///////////////////////////////////////////////// -TEST(CmdLine, MsgHelpVsCompletionFlags) +TEST(CmdLine, GZ_UTILS_TEST_DISABLED_ON_WIN32(MsgHelpVsCompletionFlags)) { // Flags in help message auto helpOutput = custom_exec_str("gz msg --help --force-version "