Skip to content

Commit

Permalink
Ensure logger tests don't generate temp directories in build dir (#1289)
Browse files Browse the repository at this point in the history
Corrects a bug introduced in #1277 which caused the logger tests to construct temporary directories in the build directory ( that never go deleted ).

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #1289
  • Loading branch information
robertmaynard authored Jun 9, 2023
1 parent 417bf14 commit b5203f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/logger_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class raii_temp_directory {
public:
raii_temp_directory()
{
directory_path_ = std::filesystem::temp_directory_path();
std::string unique_dir_name = "rmm_XXXXXX";
auto const ptr = mkdtemp(const_cast<char*>(unique_dir_name.data()));
std::string random_path{std::filesystem::temp_directory_path().string()};
random_path += "/rmm_XXXXXX";
auto const ptr = mkdtemp(const_cast<char*>(random_path.data()));
EXPECT_TRUE((ptr != nullptr));
directory_path_ /= unique_dir_name;
directory_path_ = std::filesystem::path{random_path};
}
~raii_temp_directory() { std::filesystem::remove_all(directory_path_); }

Expand Down

0 comments on commit b5203f2

Please sign in to comment.