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) diff --git a/src/Manager_TEST.cc b/src/Manager_TEST.cc index 14c9aac1..e23c288b 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; @@ -137,7 +137,7 @@ TEST_F(ManagerTest, 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 @@ -175,7 +175,7 @@ TEST_F(ManagerTest, 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 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 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.