Skip to content

Commit

Permalink
Re-enable ign tests, fix test cmd file
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Feb 1, 2021
1 parent 647ee5a commit 30a14ef
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
34 changes: 26 additions & 8 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
add_executable(
transport
# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)

set(executable transport)
add_executable(${executable}
transport_main.cc
ign.cc
)

target_link_libraries(transport
target_link_libraries(${executable}
ignition-utils${IGN_UTILS_VER}::cli
${PROJECT_LIBRARY_TARGET_NAME}
)

install(TARGETS transport DESTINATION lib/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/)
install(TARGETS ${executable} DESTINATION lib/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/)

# Build the unit tests.
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources}
TEST_LIST test_list
LIB_DEPS ${EXTRA_TEST_LIB_DEPS})

foreach(test ${test_list})

# Inform each test of its output directory so it knows where to call the
# auxiliary files from. Using a generator expression here is useful for
# multi-configuration generators, like Visual Studio.
target_compile_definitions(${test} PRIVATE
"DETAIL_IGN_TRANSPORT_TEST_DIR=\"$<TARGET_FILE_DIR:${test}>\""
"IGN_TEST_LIBRARY_PATH=\"$<TARGET_FILE_DIR:${PROJECT_LIBRARY_TARGET_NAME}>\"")

endforeach()

#===============================================================================
# Generate the ruby script for internal testing.
Expand All @@ -20,7 +40,7 @@ set(cmd_script_configured_test "${cmd_script_generated_test}.configured")

# Set the library_location variable to the full path of the library file within
# the build directory.
set(library_location "$<TARGET_FILE:${PROJECT_LIBRARY_TARGET_NAME}>")
set(exe_location "$<TARGET_FILE:${executable}>")

configure_file(
"cmd${IGN_DESIGNATION}.rb.in"
Expand All @@ -42,9 +62,7 @@ set(cmd_script_configured "${cmd_script_generated}.configured")

# Set the library_location variable to the relative path to the library file
# within the install directory structure.
set(exe_location "../../../${CMAKE_INSTALL_LIBDIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/$<TARGET_FILE_NAME:transport>")

message(STATUS ${exe_location})
set(exe_location "../../../${CMAKE_INSTALL_LIBDIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/$<TARGET_FILE_NAME:${executable}>")

configure_file(
"cmd${IGN_DESIGNATION}.rb.in"
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/cmdtransport.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class Cmd
end

args = args.join(' ')
puts "#{args}"

puts `#{exe_name} #{args}`
end
end

0 comments on commit 30a14ef

Please sign in to comment.