Skip to content

Commit

Permalink
Fix (workaround) discovering of test zim file on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Apr 15, 2021
1 parent 9adcee7 commit e070817
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ const std::vector<TestFile> getDataFilePath(const std::string& filename, const s
// We have asked for a particular category.
filePaths.emplace_back(dataDirPath, category, filename);
} else {
#ifdef _WIN32
// We don't have dirent.h in windows.
// If we move to test data out of the repository, we will need a way to discover the data.
// Use a static list of categories for now.
for (auto& category: {"normal", "nons"}) {
filePaths.emplace_back(dataDirPath, category, filename);
}
#else
struct dirent* current = NULL;
while((current = readdir(dataDir))) {
if (current->d_name[0] == '.' || current->d_name[0] == '_') {
Expand All @@ -141,6 +149,7 @@ const std::vector<TestFile> getDataFilePath(const std::string& filename, const s
filePaths.emplace_back(dataDirPath, current->d_name, filename);
}
closedir(dataDir);
#endif
}

return filePaths;
Expand Down

0 comments on commit e070817

Please sign in to comment.