From 2b383b462ff233f87e46328a51988517ac706d28 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 16 Apr 2024 17:29:10 -0500 Subject: [PATCH 1/5] Disable `ManagerTest.RunLs` test on windows Signed-off-by: Addisu Z. Taddese --- src/Manager_TEST.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Manager_TEST.cc b/src/Manager_TEST.cc index 14c9aac1..e34d4909 100644 --- a/src/Manager_TEST.cc +++ b/src/Manager_TEST.cc @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -112,7 +112,7 @@ TEST_F(ManagerTest, RunBadXml) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunLs) +TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunLs)) { std::string cmd; From ed7b2bbef9ae9a12d237a5fb84805565aafe9d1a Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Wed, 17 Apr 2024 12:01:41 -0500 Subject: [PATCH 2/5] Add dependency on ign-utils Signed-off-by: Addisu Z. Taddese --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 79180720..7833ae32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,6 +31,7 @@ ign_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${PROJECT_LIBRARY_TARGET_NAME} ignition-common${IGN_COMMON_MAJOR_VER}::ignition-common${IGN_COMMON_MAJOR_VER} + ignition-utils${IGN_UTILS_VER}::core ) add_subdirectory(cmd) From a2fae725095c4da1ae774d2efd92b75b1cb51195 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Wed, 12 Apr 2023 10:41:03 -0500 Subject: [PATCH 3/5] Use Pathname to determine if path is absolute Signed-off-by: Addisu Z. Taddese --- src/cmd/cmdlaunch.rb.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/cmdlaunch.rb.in b/src/cmd/cmdlaunch.rb.in index 6f28304e..a57abfa8 100755 --- a/src/cmd/cmdlaunch.rb.in +++ b/src/cmd/cmdlaunch.rb.in @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +require 'pathname' # Constants. LIBRARY_VERSION = '@PROJECT_VERSION_FULL@' COMMANDS = { @@ -28,9 +29,8 @@ 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. + if Pathname.new(exe_name).absolute? + # The exe_name can be absolute path during test. We'll leave it unchanged else # We're assuming that the library path is relative to the current # location of this script. From 52991dedfe069e1c078e48436e890342dd309e15 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Thu, 25 Apr 2024 14:27:52 -0500 Subject: [PATCH 4/5] Disable ign_TEST on windows, disable ManagerTest.RunEnvPre because it timesout Signed-off-by: Addisu Z. Taddese --- src/Manager_TEST.cc | 2 +- src/cmd/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Manager_TEST.cc b/src/Manager_TEST.cc index e34d4909..30b01fcb 100644 --- a/src/Manager_TEST.cc +++ b/src/Manager_TEST.cc @@ -137,7 +137,7 @@ TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunLs)) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunEnvPre) +TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunEnvPre)) { // Test that environment is applied regardless of order #ifndef _WIN32 diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index c940669a..9b773c5f 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -2,6 +2,11 @@ # "gtest_sources" variable. ign_get_libsources_and_unittests(sources gtest_sources) +# Disable tests that need CLI if ign-tools is not found +if (MSVC OR NOT IGN_TOOLS_PROGRAM) + list(REMOVE_ITEM gtest_sources ign_TEST.cc) +endif() + add_library(ign STATIC ign.cc) target_include_directories(ign PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(ign PUBLIC From 8e6b18e14fd9c2fad30f6bf77c90b804d73d85d7 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Thu, 25 Apr 2024 15:30:39 -0500 Subject: [PATCH 5/5] Disable one more test on windows Signed-off-by: Addisu Z. Taddese --- src/Manager_TEST.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager_TEST.cc b/src/Manager_TEST.cc index 30b01fcb..e23c288b 100644 --- a/src/Manager_TEST.cc +++ b/src/Manager_TEST.cc @@ -175,7 +175,7 @@ TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunEnvPre)) } ///////////////////////////////////////////////// -TEST_F(ManagerTest, RunEnvPost) +TEST_F(ManagerTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(RunEnvPost)) { // Test that environment is applied regardless of order #ifndef _WIN32