Skip to content

Working on Android Render Tests

Bart Louwers edited this page Mar 15, 2024 · 5 revisions

This is an guide that shows how to run and work on the Android render tests.

You can filter the tests to run by passing a flag to the file platform/android/src/test/render_test_runner.cpp:

std::vector<std::string> arguments = {..., "-f", "background-color/literal"};

Try running the androidRenderTest.app target.

Once the application quits, use the Device Explorer to navigate to /data/data/org.maplibre.render_test_runner/files.

image

Double click android-render-test-runner-style.html. Right click on the opened tab and select Open In > Browser. You should see that a single render test passed.

image

Now let's edit metrics/integration/render-tests/background-color/literal/style.json, change this line:

        "background-color": "red"

to

        "background-color": "yellow"

We need to make sure that the new data.zip with the data for the render tests is installed on the device. Delete the metrics directory and data.zip file in the directory we navigated to earlier with the Device Explorer. Rerun the render test app and reload the Device Explorer. When you re-open the HTML file with the results you should now see a failing test:

image

Now download the actual.png in metrics/integration/render-tests/background-color/literal with the Device Explorer. Replace the corresponding expected.png on your local file system. Delete metrics and data.zip once more and re-run the app.

image

Of we don't want to commit this change. But know you can add and debug Android render tests.