From c4c6cd78beb48dd8a7a32e2699ae6c5b92a7967b Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Fri, 10 Nov 2023 14:48:06 -0600 Subject: [PATCH] Fix gz test on windows Signed-off-by: Addisu Z. Taddese --- loader/src/cmd/cmdplugin.rb.in | 6 ++---- loader/src/gz_TEST.cc | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/loader/src/cmd/cmdplugin.rb.in b/loader/src/cmd/cmdplugin.rb.in index 936791e7..715a7a28 100644 --- a/loader/src/cmd/cmdplugin.rb.in +++ b/loader/src/cmd/cmdplugin.rb.in @@ -15,6 +15,7 @@ # limitations under the License. require 'open3' +require 'pathname' # Constants. LIBRARY_VERSION = '@PROJECT_VERSION_FULL@' @@ -30,10 +31,7 @@ class Cmd command = args[0] exe_name = COMMANDS[command] - if exe_name[0] == '/' - # If the first character is a slash, we'll assume that we've been given an - # absolute path to the executable. This is only used during test mode. - else + unless Pathname.new(exe_name).absolute? # We're assuming that the library path is relative to the current # location of this script. exe_name = File.expand_path(File.join(File.dirname(__FILE__), exe_name)) diff --git a/loader/src/gz_TEST.cc b/loader/src/gz_TEST.cc index ef8179a2..553cd663 100644 --- a/loader/src/gz_TEST.cc +++ b/loader/src/gz_TEST.cc @@ -20,6 +20,8 @@ #include #include +#include + #include "gtest/gtest.h" #include "gz/plugin/Loader.hh" @@ -211,7 +213,7 @@ TEST(gzTest, PluginInfoVerboseDummyPlugins) ////////////////////////////////////////////////// /// \brief Check --help message and bash completion script for consistent flags -TEST(gzTest, PluginHelpVsCompletionFlags) +TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(PluginHelpVsCompletionFlags)) { // Path to gz executable std::string gz = std::string(GZ_PATH);