Add support for expression test

Fix polygon within algorithm
Add Unit tests

Fix incorrect metrics folder for ios-render-test-runner job
This commit is contained in:
zmiao
2020-02-07 15:34:01 +02:00
parent 1bd2ccf239
commit 2963afa010
16 changed files with 357 additions and 1867 deletions

View File

@@ -104,8 +104,14 @@ TestRunOutput runExpressionTest(TestData& data, const std::string& rootPath, con
std::vector<Value> outputs;
if (!data.inputs.empty()) {
for (const auto& input : data.inputs) {
auto evaluationResult =
expression->evaluate(input.zoom, input.feature, input.heatmapDensity, input.availableImages);
mbgl::style::expression::EvaluationResult evaluationResult;
if (input.canonical) {
evaluationResult = expression->evaluate(
input.zoom, input.feature, input.heatmapDensity, input.availableImages, *input.canonical);
} else {
evaluationResult =
expression->evaluate(input.zoom, input.feature, input.heatmapDensity, input.availableImages);
}
if (!evaluationResult) {
std::unordered_map<std::string, Value> error{{"error", Value{evaluationResult.error().message}}};
outputs.emplace_back(Value{std::move(error)});