Skip to content

Commit

Permalink
Use find_program for gz CLI directory
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Jun 26, 2022
1 parent 1b1d479 commit 7af4e61
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ endif()
#--------------------------------------
# Find gz-tools
gz_find_package(gz-tools2 QUIET)
find_program(HAVE_GZ_TOOLS gz)

#--------------------------------------
# Find SQLite3
Expand Down
2 changes: 1 addition & 1 deletion log/test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ foreach(source_file ${aux})
endforeach()

# gz log CLI test
if (GZ-TOOLS_BINARY_DIRS)
if (HAVE_GZ_TOOLS)
set(GZ_CONFIG_PATH "${CMAKE_BINARY_DIR}/log/test/lib/ruby/gz")

add_test(gz_log_record_no_overwrite
Expand Down
24 changes: 12 additions & 12 deletions src/cmd/gz_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList))
g_partition.c_str());

// Check the 'ign topic -l' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool topicFound = false;
Expand Down Expand Up @@ -117,7 +117,7 @@ TEST(gzTest, TopicInfo)
g_partition.c_str());

// Check the 'ign topic -i' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool infoFound = false;
Expand Down Expand Up @@ -153,7 +153,7 @@ TEST(gzTest, ServiceList)
g_partition.c_str());

// Check the 'ign service -l' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool serviceFound = false;
Expand Down Expand Up @@ -184,7 +184,7 @@ TEST(gzTest, ServiceInfo)
g_partition.c_str());

// Check the 'ign service -i' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool infoFound = false;
Expand Down Expand Up @@ -220,7 +220,7 @@ TEST(gzTest, TopicListSameProc)
EXPECT_TRUE(pub.Publish(msg));

// Check the 'ign topic -l' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool topicFound = false;
Expand Down Expand Up @@ -251,7 +251,7 @@ TEST(gzTest, TopicInfoSameProc)
EXPECT_TRUE(pub.Publish(msg));

// Check the 'ign topic -i' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool infoFound = false;
Expand All @@ -276,7 +276,7 @@ TEST(gzTest, ServiceListSameProc)
EXPECT_TRUE(node.Advertise("/foo", srvEcho));

// Check the 'ign service -l' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool serviceFound = false;
Expand All @@ -299,7 +299,7 @@ TEST(gzTest, ServiceInfoSameProc)
EXPECT_TRUE(node.Advertise("/foo", srvEcho));

// Check the 'ign service -i' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";

unsigned int retries = 0u;
bool infoFound = false;
Expand All @@ -326,7 +326,7 @@ TEST(gzTest, TopicPublish)
EXPECT_TRUE(node.Subscribe("/bar", topicCB));

// Check the 'ign topic -p' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";
std::string output;

unsigned int retries = 0;
Expand Down Expand Up @@ -381,7 +381,7 @@ TEST(gzTest, ServiceRequest)
msg.set_data(10);

// Check the 'ign service -r' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";
std::string output = custom_exec_str(ign +
" service -s " + service + " --reqtype gz_msgs.Int32 " +
"--reptype gz_msgs.Int32 --timeout 1000 " +
Expand All @@ -403,7 +403,7 @@ TEST(gzTest, TopicEcho)
g_partition.c_str());

// Check the 'ign topic -e' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";
std::string output = custom_exec_str(
ign + " topic -e -t /foo -d 1.5 " + g_ignVersion);

Expand All @@ -429,7 +429,7 @@ TEST(gzTest, TopicEchoNum)
g_partition.c_str());

// Check the 'ign topic -e -n' command.
std::string ign = std::string(GZ_PATH) + "/ign";
std::string ign = std::string(GZ_PATH) + "/gz";
std::string output = custom_exec_str(
ign + " topic -e -t /foo -n 2 " + g_ignVersion);

Expand Down
2 changes: 1 addition & 1 deletion test/test_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef GZ_TRANSPORT_TEST_CONFIG_HH_
#define GZ_TRANSPORT_TEST_CONFIG_HH_

#define GZ_PATH "@GZ-TOOLS2_BINARY_DIRS@"
#define GZ_PATH "@HAVE_GZ_TOOLS@"
#define GZ_CONFIG_PATH "@CMAKE_BINARY_DIR@/test/conf"
#define GZ_VERSION_FULL "@PROJECT_VERSION_FULL@"

Expand Down

0 comments on commit 7af4e61

Please sign in to comment.