summaryrefslogtreecommitdiff
path: root/render-test/manifest_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'render-test/manifest_parser.cpp')
-rw-r--r--render-test/manifest_parser.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/render-test/manifest_parser.cpp b/render-test/manifest_parser.cpp
index f1884634e5..8b5a534027 100644
--- a/render-test/manifest_parser.cpp
+++ b/render-test/manifest_parser.cpp
@@ -34,9 +34,15 @@ const std::vector<std::pair<std::string, std::string>>& Manifest::getIgnores() c
const std::string& Manifest::getTestRootPath() const {
return testRootPath;
}
+const std::string& Manifest::getAssetPath() const {
+ return assetPath;
+}
const std::string& Manifest::getManifestPath() const {
return manifestPath;
}
+const std::string& Manifest::getResultPath() const {
+ return resultPath;
+}
void Manifest::doShuffle(uint32_t seed) {
std::seed_seq sequence{seed};
@@ -239,7 +245,7 @@ mbgl::filesystem::path getValidPath(const std::string& manifestPath, const std::
result = BasePath / result;
}
if (mbgl::filesystem::exists(result)) {
- return result;
+ return result.lexically_normal();
}
mbgl::Log::Warning(mbgl::Event::General, "Invalid path is provoided inside the manifest file: %s", path.c_str());
return mbgl::filesystem::path{};
@@ -285,6 +291,18 @@ mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manife
return mbgl::nullopt;
}
}
+ if (document.HasMember("result_path")) {
+ const auto& resultPathValue = document["result_path"];
+ if (!resultPathValue.IsString()) {
+ mbgl::Log::Warning(
+ mbgl::Event::General, "Invalid assetPath is provoided inside the manifest file: %s", filePath.c_str());
+ return mbgl::nullopt;
+ }
+ manifest.resultPath = (getValidPath(manifest.manifestPath, resultPathValue.GetString()) / "").string();
+ if (manifest.resultPath.empty()) {
+ return mbgl::nullopt;
+ }
+ }
mbgl::filesystem::path baseTestPath;
if (document.HasMember("base_test_path")) {
const auto& testPathValue = document["base_test_path"];
@@ -366,6 +384,11 @@ mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manife
if (manifest.manifestPath.back() == '/') {
manifest.manifestPath.pop_back();
}
+ if (manifest.resultPath.empty()) {
+ manifest.resultPath = manifest.manifestPath;
+ } else if (manifest.resultPath.back() == '/') {
+ manifest.resultPath.pop_back();
+ }
std::vector<mbgl::filesystem::path> paths;
for (const auto& id : testNames) {