[render-test] Wrap test data inside RenderTestRunner App + Add a new test app (#15887)

* [render-test] Wrap test resources inside app

* [render-test] Add test app

* fix test app failure

* [render-test]add callback + add javaObjectWrapper
This commit is contained in:
zmiao
2019-11-19 20:45:30 +02:00
committed by GitHub
parent abdd32d11f
commit 1b58e87f15
17 changed files with 400 additions and 79 deletions

View File

@@ -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) {