-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tests into system temporary directory (#3290)
- Loading branch information
1 parent
c65b494
commit ab0db8f
Showing
6 changed files
with
29 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
#include "graph_test/graph_test.h" | ||
#include "test_helper/test_helper.h" | ||
|
||
using namespace kuzu::testing; | ||
using namespace kuzu::common; | ||
|
||
void deleteMatchingDir(const std::string& dirPath, const std::string& match) { | ||
for (const auto& entry : std::filesystem::directory_iterator(dirPath)) { | ||
if (entry.path().filename().string().find(match) != std::string::npos) { | ||
std::filesystem::remove_all(entry.path().string()); | ||
} | ||
} | ||
} | ||
|
||
int main(int argc, char** argv) { | ||
std::vector<std::string> tempDirs = {TestHelper::PARQUET_TEMP_DATASET_PATH, | ||
TestHelper::TMP_TEST_DIR}; | ||
if (argc > 1 && std::string(argv[1]) == "--gtest_list_tests") { | ||
for (const auto& tempDir : tempDirs) { | ||
// path = test/unittest_temp_ | ||
std::filesystem::path path = tempDir; | ||
// dirToCheck = test | ||
std::string dirToCheck = path.parent_path().string(); | ||
// dirPatternToRemove = unittest_temp_ | ||
std::string dirPatternToRemove = path.filename().string(); | ||
deleteMatchingDir(TestHelper::appendKuzuRootPath(dirToCheck), dirPatternToRemove); | ||
} | ||
std::filesystem::remove_all(TestHelper::getTempDir()); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters