From eb209904d3ec7fe53aa95f7ec6953218e059d52a Mon Sep 17 00:00:00 2001 From: Martin d'Allens Date: Sat, 18 Nov 2023 16:16:29 +0100 Subject: [PATCH] Update READMEs, fix typos (#1876) --- DEVELOPING.md | 10 +++++----- metrics/cache-style.db | Bin 19214336 -> 19214336 bytes metrics/integration/README.md | 33 +++++++++++++------------------- render-test/manifest_parser.cpp | 2 +- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/DEVELOPING.md b/DEVELOPING.md index 17f78e3b2..cdbc0ec43 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -13,9 +13,9 @@ to install the pre-commit hooks configured in `.pre-commit-config.yml`. ## Render Tests -To check that the output of the rendering is correct, we compare actual rendered PNGs for simple styles with expected PNGs. The content of the tests is stored in the MapLibre GL JS submodule which means that GL JS and Native are in fact quasi pixel-identical in their rendering. +To check that the output of the rendering is correct, we compare actual rendered PNGs for simple styles with expected PNGs. The content of the tests used to be stored in the MapLibre GL JS repository, which means that GL JS and Native are mostly pixel-identical in their rendering. -The directory sturcture of the render tests looks like: +The directory structure of the render tests looks like: ``` metrics/ @@ -78,7 +78,7 @@ The render test results are summarized in a HTML website located next to the man # MapLibre & C++ -MapLibre makes use of a common set of C++ files for iOS, macOS, Android, Linux & Qt. See [`platform/default/src/mbgl/`](`platform/default/src/mbgl/`), +MapLibre makes use of a common set of C++ files for iOS, macOS, Android, Linux & Qt. See [`platform/default/src/mbgl/`](`platform/default/src/mbgl/`), or any of the platform make files: * [`platform/android/android.cmake`](platform/android/android.cmake) @@ -147,7 +147,7 @@ Which will log the following samples. ### Autocomplete with `make` -MapLibre makes use of several command line tools for local and cloud builds. +MapLibre makes use of several command line tools for local and cloud builds. To see what targets exist you have to review the `Makefile`, which can be tedious. There is a better way with the Zsh. While in a folder with a `Makefile`, you can type `make` followed by hitting `` twice. @@ -176,7 +176,7 @@ To add this feature add the following to your zsh. ```zsh # open ~/.zprofile -# Autocomplete for `make` when in a directory +# Autocomplete for `make` when in a directory zstyle ':completion:*:*:make:*' tag-order 'targets' autoload -Uz compinit && compinit ``` diff --git a/metrics/cache-style.db b/metrics/cache-style.db index 235d42c210829b44c9a1e86436aa366b4b1fe4d9..e26cc7689108caa9981fbfe2d90029e2ee9bf4a2 100644 GIT binary patch delta 3669 zcmX|?dt6i39l-AiAjwVc15k_!8U(b6R-=L_DvgLDS~c~t)ooSkw7S)4be;260i}nk z5%aLdDoUKsS|2d!iR)}ayFPr-3c9w_x;1XKwyxFq7~L?|{qDWz@W=P_`QG2}cOLhg zbI+}cZZ}i`9*geQCT~Vbw_BUI!Anm!E!Z33i@0NkX2g%+2l=P9Os+IOYn)~*HN*^G z8?G5H8O|EQeAHMk&6b|#AMm&MUA%|K#wEu2#+AY{X^*sB+9GX`R!c5vku=xn7fuKV zrJ=mYCmK2p%~GzEZrWy=W3ou&C7T!(_lY~j7sWE6L-<}Qk`l#x;+TbI?*x-4#Mm$|9sa9g@;Gqr4P zQwR7xjNsdSW48$XfCgb7q+HZgfTjaW;lWQ=3tV5z5=6tmP=DwZ)!Mzd5A6>H@v z78=Q3}dOGEM;erA*^OFOFhX_gP06t8)nU8)dQI1vZ5!bWb|j! zkEL>$WV2Kj6-!^1%4A|=HGNp5w;oQoa&R&-Xvl1(VzE%^*^5ewnToY1t4Y_yceMwT z?lgtcn4~gEVInh;^a+*f@JM7Kfr*KV&B%nOl5e0gR?i~IREm?BBvL6)pfai($8iRD z)e%WN*gVrw&h${4cgoZjyQq8(r8tOiP=|vFIG9L+N%00HT8z8&!L}-5fgJ-fQ|`HPLL@ua0l4J#4as4x6mA6O_1($kwwu#ZYZ)sujop zdINnzt*N##J=9dllxvG6t4i#)RccEVS~uL*Gf@o&0)@7vTBTv6?LMt^*y57b#%YVs z1M^)ajkfq5&4QV#`7PMfmw2*fsH2js=D}K#6-Nh?=#b?YXWgiWPLl! zh;tHKI7c~gOlD=V$s{&K%Vgl_(Gd0gP&tWr&&LPpCv2ogdPTGD!i?HW8;+d;GWMJ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/metrics/integration/README.md index 77c43e037..4cc6be1ec 100644 --- a/metrics/integration/README.md +++ b/metrics/integration/README.md @@ -1,9 +1,8 @@ -These integration tests verify the correctness and consistency of [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js) and -[mapbox-gl-native](https://github.com/mapbox/mapbox-gl-native) rendering. +These integration tests verify the correctness and consistency of [MapLibre Native](https://github.com/maplibre/maplibre-native) rendering. ## Organization -Tests are contained in a directory tree, generally organized by [style specification](https://github.com/mapbox/mapbox-gl-style-spec) +Tests are contained in a directory tree, generally organized by [style specification](https://maplibre.org/maplibre-style-spec/) property: `background-color`, `line-width`, etc., with a second level of directories below that for individual tests. For example, the test for specifying a literal `circle-radius` value lives in [`test/integration/render-tests/circle-radius/literal/`](https://github.com/mapbox/mapbox-gl-js/tree/master/test/integration/render-tests/circle-radius/literal). Within a leaf directory is a `style.json` file (e.g. [`circle-radius/literal/style.json`](https://github.com/mapbox/mapbox-gl-js/blob/master/test/integration/render-tests/circle-radius/literal/style.json)), which contains the minimal style needed for the given test case. The style can specify the map size, center, bearing, and pitch, and additional test metadata (e.g. output image dimensions). @@ -17,26 +16,23 @@ The contents of vector tile fixtures can be read using the [`vt2geojson`](https: ## Running tests -To run the entire integration test suite (both render or query tests), from within the `mapbox-gl-js` directory run the command: +To run the entire integration test suite (both render or query tests), from within the maplibre-native directory on Linux run the command: + ``` -yarn run test-suite +./build/mbgl-render-test-runner --manifestPath metrics/linux-clang8-release-style.json ``` To run only the render/query tests: ``` -yarn run test-render -``` -or -``` -yarn run test-query-node +npm run test-render ``` ### Running specific tests To run a subset of tests or an individual test, you can pass a specific subdirectory to the `test-render` script. For example, to run all the tests for a given property, e.g. `circle-radius`: ``` -$ yarn run test-render circle-radius +$ npm run test-render circle-radius ... * passed circle-radius/antimeridian * passed circle-radius/default @@ -50,7 +46,7 @@ Done in 2.71s. ``` Or to run a single test: ``` -$ yarn run test-render circle-radius/literal +$ npm run test-render circle-radius/literal ... * passed circle-radius/literal 1 passed (100.0%) @@ -76,16 +72,16 @@ open ./test/integration/query-tests/index.html Query tests can be run in the browser, the server for serving up the test page and test fixtures starts when you run ``` -yarn run start +npm run start ``` OR ``` -yarn run start-debug +npm run start-debug ``` If you want to run only the test server run: ``` -yarn run watch-query +npm run watch-query ``` Then open the following url in the browser of your choice to start running the tests. @@ -112,9 +108,6 @@ DISABLE_BUILD_NOTIFICATIONS=true ## Writing new tests -_Note: Expected results are always generated with the **js** implementation. This is merely for consistency and does not -imply that in the event of a rendering discrepancy, the js implementation is always correct._ - To add a new render test: 1. Create a new directory `test/integration/render-tests//` @@ -122,11 +115,11 @@ To add a new render test: 3. Generate an `expected.png` image from the given style by running the new test with the `UPDATE` flag enabled: ``` - $ UPDATE=1 yarn run test-render / + $ UPDATE=1 npm run test-render / ``` The test will appear to fail, but you'll now see a new `expected.png` in the test directory. -4. Manually inspect `expected.png` to verify it looks as expected, and optionally run the test again without the update flag (`yarn run test-render /`) to watch it pass (enjoy that dopamine kick!) +4. Manually inspect `expected.png` to verify it looks as expected, and optionally run the test again without the update flag (`npm run test-render /`) to watch it pass (enjoy that dopamine kick!) 5. Commit the new `style.json` and `expected.png` :rocket: diff --git a/render-test/manifest_parser.cpp b/render-test/manifest_parser.cpp index 486ac363c..e22edd8d3 100644 --- a/render-test/manifest_parser.cpp +++ b/render-test/manifest_parser.cpp @@ -74,7 +74,7 @@ std::vector> parseIgnores(const std::vector< // defaultExpectationPath: absolute path that constains the style.json file for testing // testId: Test case id that used for composing expectation path -// expectatedPaths: absolute paths that constain possible expected.png/metrics.json files for result checking +// expectatedPaths: absolute paths that contain possible expected.png/metrics.json files for result checking std::vector getTestExpectations(const mbgl::filesystem::path& defaultExpectationPath, const std::string& testId, std::vector expectatedPaths) {