Skip to content

Commit

Permalink
Migrate ignTest to gzTest
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Jun 13, 2022
1 parent edad03b commit 07a4412
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions loader/src/gz_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using namespace gz;

static const std::string g_ignVersion("--force-version " + // NOLINT(*)
static const std::string g_gzVersion("--force-version " + // NOLINT(*)
std::string(GZ_VERSION_FULL));

/////////////////////////////////////////////////
Expand All @@ -55,19 +55,19 @@ std::string custom_exec_str(std::string _cmd)

//////////////////////////////////////////////////
/// \brief Check 'gz plugin --help'.
TEST(ignTest, IgnPluginHelp)
TEST(gzTest, IgnPluginHelp)
{
// Path to gz executable
std::string ign = std::string(GZ_PATH);
std::string output = custom_exec_str(ign + " plugin --help");
std::string gz = std::string(GZ_PATH);
std::string output = custom_exec_str(gz + " plugin --help");
EXPECT_NE(std::string::npos,
output.find("-i,--info Get info about a plugin."))
<< output;
EXPECT_NE(std::string::npos,
output.find("-p,--plugin TEXT Needs: --info"))
<< output;

output = custom_exec_str(ign + " plugin");
output = custom_exec_str(gz + " plugin");
EXPECT_NE(std::string::npos,
output.find("-i,--info Get info about a plugin."))
<< output;
Expand All @@ -78,12 +78,12 @@ TEST(ignTest, IgnPluginHelp)

//////////////////////////////////////////////////
/// \brief Check 'gz plugin --info' for a non-existent file.
TEST(ignTest, PluginInfoNonexistentLibrary)
TEST(gzTest, PluginInfoNonexistentLibrary)
{
// Path to gz executable
std::string ign = std::string(GZ_PATH);
std::string gz = std::string(GZ_PATH);

std::string output = custom_exec_str(ign + " plugin --info --plugin " +
std::string output = custom_exec_str(gz + " plugin --info --plugin " +
"/path/to/libDoesNotExist.so");

EXPECT_NE(std::string::npos, output.find("Error while loading the library"))
Expand All @@ -96,12 +96,12 @@ TEST(ignTest, PluginInfoNonexistentLibrary)

//////////////////////////////////////////////////
/// \brief Check 'gz plugin --info' for a file that isn't a shared library.
TEST(ignTest, PluginInfoNonLibrary)
TEST(gzTest, PluginInfoNonLibrary)
{
// Path to gz executable
std::string ign = std::string(GZ_PATH);
std::string gz = std::string(GZ_PATH);

std::string output = custom_exec_str(ign + " plugin --info --plugin " +
std::string output = custom_exec_str(gz + " plugin --info --plugin " +
std::string(GZ_PLUGIN_SOURCE_DIR) + "/core/src/Plugin.cc");

EXPECT_NE(std::string::npos, output.find("Error while loading the library"))
Expand All @@ -114,12 +114,12 @@ TEST(ignTest, PluginInfoNonLibrary)

//////////////////////////////////////////////////
/// \brief Check 'gz plugin --info' for a library that has no plugins.
TEST(ignTest, PluginInfoNonPluginLibrary)
TEST(gzTest, PluginInfoNonPluginLibrary)
{
// Path to gz executable
std::string ign = std::string(GZ_PATH);
std::string gz = std::string(GZ_PATH);

std::string output = custom_exec_str(ign + " plugin --info --plugin " +
std::string output = custom_exec_str(gz + " plugin --info --plugin " +
GZ_PLUGIN_LIB);

EXPECT_NE(std::string::npos, output.find("does not export any plugins. The "
Expand All @@ -133,12 +133,12 @@ TEST(ignTest, PluginInfoNonPluginLibrary)

//////////////////////////////////////////////////
/// \brief Check 'gz plugin --info' for a library with plugins.
TEST(ignTest, PluginInfoDummyPlugins)
TEST(gzTest, PluginInfoDummyPlugins)
{
// Path to gz executable
std::string ign = std::string(GZ_PATH);
std::string gz = std::string(GZ_PATH);

std::string output = custom_exec_str(ign + " plugin --info --plugin " +
std::string output = custom_exec_str(gz + " plugin --info --plugin " +
GzDummyPlugins_LIB);

EXPECT_NE(std::string::npos, output.find("Found 3 plugins in library file"))
Expand Down Expand Up @@ -172,12 +172,12 @@ TEST(ignTest, PluginInfoDummyPlugins)

//////////////////////////////////////////////////
/// \brief Check 'gz plugin --info' with verbose output.
TEST(ignTest, PluginInfoVerboseDummyPlugins)
TEST(gzTest, PluginInfoVerboseDummyPlugins)
{
// Path to gz executable
std::string ign = std::string(GZ_PATH);
std::string gz = std::string(GZ_PATH);

std::string output = custom_exec_str(ign + " plugin --info --plugin " +
std::string output = custom_exec_str(gz + " plugin --info --plugin " +
GzDummyPlugins_LIB + " --verbose");

EXPECT_NE(std::string::npos, output.find("Known Interfaces: 7"))
Expand Down

0 comments on commit 07a4412

Please sign in to comment.