Skip to content

Commit

Permalink
More work using the subprocess object
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Oct 31, 2023
1 parent 272e005 commit 2d7b3a4
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 214 deletions.
9 changes: 4 additions & 5 deletions log/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ gz_build_tests(
)

foreach(test_target ${logging_tests})

set_tests_properties(${logging_tests} PROPERTIES
set_tests_properties(${test_target} PROPERTIES
ENVIRONMENT GZ_TRANSPORT_LOG_SQL_PATH=${PROJECT_SOURCE_DIR}/log/sql)
target_compile_definitions(${test_target} PRIVATE
"CORRUPT_DB_TEST_PATH=\"${CMAKE_SOURCE_DIR}/log/test/data/state.tlog\""
)

endforeach()

Expand All @@ -46,9 +48,6 @@ install(DIRECTORY ../sql DESTINATION ${SCHEMA_INSTALL_BASE})
set(SCHEMA_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${SCHEMA_INSTALL_BASE}/sql)
configure_file(build_config.hh.in build_config.hh @ONLY)


message(STATUS "CMAKE_CURRENT_SOURCE_DIR:${CMAKE_CURRENT_SOURCE_DIR}")

target_include_directories(${log_lib_target}
PUBLIC
# Add this component's include directory to the build interface include
Expand Down
10 changes: 5 additions & 5 deletions log/src/Log_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@

#include "gz/transport/log/Log.hh"
#include "test_config.hh"
#include "log/test_config.hh"
#include "gtest/gtest.h"

using namespace gz;
using namespace gz::transport;
using namespace std::chrono_literals;

namespace {
constexpr const char * kCorruptDbTestPath = CORRUPT_DB_TEST_PATH;
}

//////////////////////////////////////////////////
TEST(Log, OpenMemoryDatabase)
{
Expand Down Expand Up @@ -251,10 +254,7 @@ TEST(Log, NullDescriptorUnopenedLog)
TEST(Log, OpenCorruptDatabase)
{
log::Log logFile;
std::string path =
testing::portablePathUnion(GZ_TRANSPORT_LOG_TEST_PATH, "data");
path = testing::portablePathUnion(path, "state.tlog");
logFile.Open(path);
logFile.Open(kCorruptDbTestPath);
EXPECT_GT(logFile.EndTime(), 0ns) << "logFile.EndTime() == "
<< logFile.EndTime().count() << "ns";;
}
2 changes: 2 additions & 0 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ foreach(test ${test_list})
"GZ_TEST_LIBRARY_PATH=\"$<TARGET_FILE_DIR:${PROJECT_LIBRARY_TARGET_NAME}>\""
"PROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\""
"TWO_PROCS_PUBLISHER_EXE=\"$<TARGET_FILE:twoProcsPublisher_aux>\""
"TWO_PROCS_SRV_CALL_REPLIER_EXE=\"$<TARGET_FILE:twoProcsSrvCallReplier_aux>\""
"DETAIL_GZ_TRANSPORT_TEST_DIR=\"$<TARGET_FILE_DIR:UNIT_gz_TEST>\""
"GZ_EXE=\"${HAVE_GZ_TOOLS}\""
)

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/cmdtransport.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Cmd
exe_name = File.expand_path(File.join(File.dirname(__FILE__), exe_name))
end
conf_version = LIBRARY_VERSION
exe_version = `#{exe_name} --version`.strip
exe_version = `#{exe_name} --version 2>&1`

# Sanity check: Verify that the version of the yaml file matches the version
# of the library that we are using.
Expand Down
Loading

0 comments on commit 2d7b3a4

Please sign in to comment.