Skip to content

Commit

Permalink
Create directories and more output on fail (#392)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored Dec 11, 2023
1 parent 32d8329 commit b80abc3
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/gz_src_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ class CmdLine : public ::testing::Test
// instead of on teardown leaves the folder intact for debugging if needed
common::removeAll(testCachePath);
ASSERT_TRUE(common::createDirectories(testCachePath));
ASSERT_TRUE(common::createDirectories(
common::joinPaths(testCachePath, "fuel.gazebosim.org")));
ASSERT_TRUE(common::createDirectories(
common::joinPaths(testCachePath, "fuel.ignitionrobotics.org")));

setenv("IGN_FUEL_CACHE_PATH", this->testCachePath.c_str(), true);
}

Expand Down Expand Up @@ -85,7 +90,7 @@ TEST_F(CmdLine, ModelListFail)

EXPECT_NE(this->stdOutBuffer.str().find("Invalid URL"),
std::string::npos) << this->stdOutBuffer.str();
EXPECT_TRUE(this->stdErrBuffer.str().empty());
EXPECT_TRUE(this->stdErrBuffer.str().empty()) << this->stdErrBuffer.str();
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -397,21 +402,21 @@ TEST_P(DownloadCollectionTest, AllItems)
"openrobotics", "models", "backpack")));
EXPECT_TRUE(common::isDirectory(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "backpack", "2")));
"openrobotics", "models", "backpack", "3")));
EXPECT_TRUE(common::isFile(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "backpack", "2", "model.sdf")));
"openrobotics", "models", "backpack", "3", "model.sdf")));

// Model: TEAMBASE
EXPECT_TRUE(common::isDirectory(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "teambase")));
EXPECT_TRUE(common::isDirectory(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "teambase", "2")));
"openrobotics", "models", "teambase", "3")));
EXPECT_TRUE(common::isFile(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "teambase", "2", "model.sdf")));
"openrobotics", "models", "teambase", "3", "model.sdf")));

// World: Test World
EXPECT_TRUE(common::isDirectory(
Expand Down Expand Up @@ -460,21 +465,21 @@ TEST_P(DownloadCollectionTest, Models)
"openrobotics", "models", "backpack")));
EXPECT_TRUE(common::isDirectory(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "backpack", "2")));
"openrobotics", "models", "backpack", "3")));
EXPECT_TRUE(common::isFile(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "backpack", "2", "model.sdf")));
"openrobotics", "models", "backpack", "3", "model.sdf")));

// Model: TEAMBASE
EXPECT_TRUE(common::isDirectory(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "teambase")));
EXPECT_TRUE(common::isDirectory(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "teambase", "2")));
"openrobotics", "models", "teambase", "3")));
EXPECT_TRUE(common::isFile(
common::joinPaths(this->testCachePath, "fuel.gazebosim.org",
"openrobotics", "models", "teambase", "2", "model.sdf")));
"openrobotics", "models", "teambase", "3", "model.sdf")));

// World: Test World
EXPECT_FALSE(common::isDirectory(
Expand Down

0 comments on commit b80abc3

Please sign in to comment.