Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maerki committed Feb 28, 2025
1 parent b718a13 commit d7e3dcf
Show file tree
Hide file tree
Showing 95 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/ios/BasemapLayerPerformanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Testing
@Suite(.serialized)
struct BasemapLayerPerformanceTests {

@Test func testFPSStability() async throws {
@Test(.disabled("Too slow")) func testFPSStability() async throws {
let view = TestingMapView(DataProvider("https://vectortiles.geo.admin.ch/styles/ch.swisstopo.basemap.vt/style.json"))

try await view.prepare(.zurich)
Expand Down
2 changes: 1 addition & 1 deletion tests/ios/BasemapPerformanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class BasemapPerformanceTests: XCTestCase {

let view = TestingMapView(DataProvider("https://vectortiles.geo.admin.ch/styles/ch.swisstopo.basemap.vt/style.json"))

try await view.prepare(.aletsch)
try await view.prepare(.zurich)

let options = XCTMeasureOptions.default
options.iterationCount = 10
Expand Down
Binary file added tests/ios/__Requests__/00ce2e25ed-2870.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/010517b821-2896.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/02aac5a7b5-2898.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/0358a19a36-2868.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/0fea7f2121-2866.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/18ee7988e7-2864.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/1b9e934a31-2902.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/20de6e70ec-2897.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/ios/__Requests__/2d3e619dee-style.json

Large diffs are not rendered by default.

Binary file added tests/ios/__Requests__/3514208cbd-2869.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/36060340a9-45.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
1 change: 1 addition & 0 deletions tests/ios/__Requests__/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"windturbine_white": {"width": 64, "height": 76, "x": 0, "y": 0, "pixelRatio": 2.0}, "communications_tower_white": {"width": 48, "height": 66, "x": 64, "y": 0, "pixelRatio": 2.0}, "observation_tower_white": {"width": 52, "height": 62, "x": 0, "y": 76, "pixelRatio": 2.0}, "airplane_large_white": {"width": 56, "height": 56, "x": 52, "y": 76, "pixelRatio": 2.0}, "airplane_medium_white": {"width": 54, "height": 54, "x": 108, "y": 76, "pixelRatio": 2.0}, "golf_white": {"width": 52, "height": 54, "x": 162, "y": 76, "pixelRatio": 2.0}, "camping_white": {"width": 44, "height": 48, "x": 112, "y": 0, "pixelRatio": 2.0}, "airplane_small_white": {"width": 46, "height": 46, "x": 156, "y": 0, "pixelRatio": 2.0}, "castle_white": {"width": 32, "height": 44, "x": 214, "y": 76, "pixelRatio": 2.0}, "viewpoint_white": {"width": 52, "height": 42, "x": 202, "y": 0, "pixelRatio": 2.0}, "cave_white": {"width": 56, "height": 40, "x": 0, "y": 138, "pixelRatio": 2.0}, "hospital_white": {"width": 38, "height": 38, "x": 56, "y": 138, "pixelRatio": 2.0}, "waterfall_blue": {"width": 24, "height": 36, "x": 94, "y": 138, "pixelRatio": 2.0}, "circle_black_12": {"width": 32, "height": 32, "x": 118, "y": 138, "pixelRatio": 2.0}, "circle_circle_black_12": {"width": 32, "height": 32, "x": 150, "y": 138, "pixelRatio": 2.0}, "dot_circle_black_12": {"width": 32, "height": 32, "x": 182, "y": 138, "pixelRatio": 2.0}, "helicopter_white": {"width": 52, "height": 32, "x": 0, "y": 178, "pixelRatio": 2.0}, "box_white_grey_casing_1": {"width": 24, "height": 28, "x": 52, "y": 178, "pixelRatio": 2.0}, "box_white_grey_casing_10": {"width": 120, "height": 28, "x": 76, "y": 178, "pixelRatio": 2.0}, "box_white_grey_casing_11": {"width": 132, "height": 28, "x": 0, "y": 210, "pixelRatio": 2.0}, "box_white_grey_casing_12": {"width": 144, "height": 28, "x": 0, "y": 238, "pixelRatio": 2.0}, "box_white_grey_casing_2": {"width": 36, "height": 28, "x": 132, "y": 210, "pixelRatio": 2.0}, "box_white_grey_casing_3": {"width": 44, "height": 28, "x": 168, "y": 210, "pixelRatio": 2.0}, "box_white_grey_casing_4": {"width": 56, "height": 28, "x": 144, "y": 238, "pixelRatio": 2.0}, "box_white_grey_casing_5": {"width": 68, "height": 28, "x": 0, "y": 266, "pixelRatio": 2.0}, "box_white_grey_casing_6": {"width": 76, "height": 28, "x": 68, "y": 266, "pixelRatio": 2.0}, "box_white_grey_casing_7": {"width": 88, "height": 28, "x": 144, "y": 266, "pixelRatio": 2.0}, "box_white_grey_casing_8": {"width": 100, "height": 28, "x": 212, "y": 210, "pixelRatio": 2.0}, "box_white_grey_casing_9": {"width": 108, "height": 28, "x": 312, "y": 210, "pixelRatio": 2.0}, "circle_black_10": {"width": 28, "height": 28, "x": 420, "y": 210, "pixelRatio": 2.0}, "circle_circle_black_10": {"width": 28, "height": 28, "x": 448, "y": 210, "pixelRatio": 2.0}, "dot_circle_black_10": {"width": 28, "height": 28, "x": 476, "y": 210, "pixelRatio": 2.0}, "circle_black_8": {"width": 24, "height": 24, "x": 200, "y": 238, "pixelRatio": 2.0}, "dot_circle_black_8": {"width": 24, "height": 24, "x": 224, "y": 238, "pixelRatio": 2.0}, "circle_black_6": {"width": 20, "height": 20, "x": 248, "y": 238, "pixelRatio": 2.0}, "dot_circle_black_6": {"width": 20, "height": 20, "x": 268, "y": 238, "pixelRatio": 2.0}, "square_red": {"width": 20, "height": 20, "x": 288, "y": 238, "pixelRatio": 2.0}, "circle_black_4": {"width": 16, "height": 16, "x": 308, "y": 238, "pixelRatio": 2.0}, "dot_blue": {"width": 16, "height": 16, "x": 324, "y": 238, "pixelRatio": 2.0}, "dot_red": {"width": 16, "height": 16, "x": 340, "y": 238, "pixelRatio": 2.0}}
Binary file added tests/ios/__Requests__/39bc5a3955-2896.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/3ca68e2ae0-2898.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/3d595605e9-2902.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/4102b1ff9f-2901.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/423a79e1a4-2869.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/42a90bbb0f-2864.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/4a99db04aa-2870.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/4abcbd6f7b-2898.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/4db8efb471-2901.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/4f9d54616a-2869.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/506a3ab606-2896.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/519fbffa43-44.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/52bc6230fe-2900.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/ios/__Requests__/53bab0bde0-2867.jpeg
Binary file added tests/ios/__Requests__/53caab8298-2870.jpeg
Binary file added tests/ios/__Requests__/579534a70b-2865.jpeg
Binary file added tests/ios/__Requests__/5e4093b43a-2901.jpeg
Binary file added tests/ios/__Requests__/5f1b12598c-2866.jpeg
Binary file added tests/ios/__Requests__/64a9ab5a2c-2900.jpeg
Binary file added tests/ios/__Requests__/6d44f196db-2868.jpeg
Binary file added tests/ios/__Requests__/6ee977ba12-2872.jpeg
Binary file added tests/ios/__Requests__/737c6ce25b-2901.jpeg
Binary file added tests/ios/__Requests__/765b5cb6d3-2897.jpeg
Binary file added tests/ios/__Requests__/7edb03164e-2871.jpeg
Binary file added tests/ios/__Requests__/82adb5ce14-2871.jpeg
Binary file added tests/ios/__Requests__/83bcf9adb8-2865.jpeg
Binary file added tests/ios/__Requests__/843d893fcc-2897.jpeg
Binary file added tests/ios/__Requests__/85789aa144-2871.jpeg
1 change: 1 addition & 0 deletions tests/ios/__Requests__/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"scree_very_large_1": {"width": 256, "height": 256, "x": 0, "y": 0, "pixelRatio": 2.0}, "scree_very_large_2": {"width": 256, "height": 256, "x": 256, "y": 0, "pixelRatio": 2.0}, "scree_very_large_3": {"width": 256, "height": 256, "x": 0, "y": 256, "pixelRatio": 2.0}, "scree_very_large_4": {"width": 256, "height": 256, "x": 256, "y": 256, "pixelRatio": 2.0}, "scree_large_1": {"width": 128, "height": 128, "x": 512, "y": 0, "pixelRatio": 2.0}, "scree_large_2": {"width": 128, "height": 128, "x": 640, "y": 0, "pixelRatio": 2.0}, "scree_large_3": {"width": 128, "height": 128, "x": 768, "y": 0, "pixelRatio": 2.0}, "scree_large_4": {"width": 128, "height": 128, "x": 896, "y": 0, "pixelRatio": 2.0}, "wetland_blue": {"width": 128, "height": 128, "x": 512, "y": 256, "pixelRatio": 2.0}, "scree_medium_1": {"width": 64, "height": 64, "x": 640, "y": 256, "pixelRatio": 2.0}, "scree_medium_2": {"width": 64, "height": 64, "x": 704, "y": 256, "pixelRatio": 2.0}, "scree_medium_3": {"width": 64, "height": 64, "x": 768, "y": 256, "pixelRatio": 2.0}, "scree_medium_4": {"width": 64, "height": 64, "x": 832, "y": 256, "pixelRatio": 2.0}, "windturbine_grey": {"width": 48, "height": 64, "x": 896, "y": 256, "pixelRatio": 2.0}, "airplane_large_grey": {"width": 56, "height": 56, "x": 944, "y": 256, "pixelRatio": 2.0}, "airplane_medium_grey": {"width": 52, "height": 52, "x": 0, "y": 512, "pixelRatio": 2.0}, "communications_tower_grey": {"width": 36, "height": 52, "x": 52, "y": 512, "pixelRatio": 2.0}, "observation_tower_grey": {"width": 36, "height": 50, "x": 88, "y": 512, "pixelRatio": 2.0}, "airplane_small_grey": {"width": 48, "height": 48, "x": 124, "y": 512, "pixelRatio": 2.0}, "arrow_line_blue": {"width": 48, "height": 38, "x": 172, "y": 512, "pixelRatio": 2.0}, "golf_grey": {"width": 28, "height": 36, "x": 220, "y": 512, "pixelRatio": 2.0}, "arrow_blue": {"width": 12, "height": 32, "x": 248, "y": 512, "pixelRatio": 2.0}, "arrow_brown": {"width": 12, "height": 32, "x": 260, "y": 512, "pixelRatio": 2.0}, "arrow_grey": {"width": 12, "height": 32, "x": 272, "y": 512, "pixelRatio": 2.0}, "castle_grey": {"width": 20, "height": 32, "x": 284, "y": 512, "pixelRatio": 2.0}, "forkknife_crossed_grey": {"width": 34, "height": 32, "x": 304, "y": 512, "pixelRatio": 2.0}, "orchard_green": {"width": 32, "height": 32, "x": 338, "y": 512, "pixelRatio": 2.0}, "scree_small_1": {"width": 32, "height": 32, "x": 370, "y": 512, "pixelRatio": 2.0}, "scree_small_2": {"width": 32, "height": 32, "x": 402, "y": 512, "pixelRatio": 2.0}, "scree_small_3": {"width": 32, "height": 32, "x": 434, "y": 512, "pixelRatio": 2.0}, "scree_small_4": {"width": 32, "height": 32, "x": 466, "y": 512, "pixelRatio": 2.0}, "vinyard_green": {"width": 32, "height": 32, "x": 498, "y": 512, "pixelRatio": 2.0}, "viewpoint_grey": {"width": 36, "height": 30, "x": 530, "y": 512, "pixelRatio": 2.0}, "box_white_grey_casing_1": {"width": 24, "height": 28, "x": 566, "y": 512, "pixelRatio": 2.0}, "box_white_grey_casing_10": {"width": 120, "height": 28, "x": 590, "y": 512, "pixelRatio": 2.0}, "box_white_grey_casing_11": {"width": 132, "height": 28, "x": 710, "y": 512, "pixelRatio": 2.0}, "box_white_grey_casing_12": {"width": 144, "height": 28, "x": 842, "y": 512, "pixelRatio": 2.0}, "box_white_grey_casing_2": {"width": 36, "height": 28, "x": 986, "y": 512, "pixelRatio": 2.0}, "box_white_grey_casing_3": {"width": 44, "height": 28, "x": 0, "y": 564, "pixelRatio": 2.0}, "box_white_grey_casing_4": {"width": 56, "height": 28, "x": 44, "y": 564, "pixelRatio": 2.0}, "box_white_grey_casing_5": {"width": 68, "height": 28, "x": 100, "y": 564, "pixelRatio": 2.0}, "box_white_grey_casing_6": {"width": 76, "height": 28, "x": 168, "y": 564, "pixelRatio": 2.0}, "box_white_grey_casing_7": {"width": 88, "height": 28, "x": 244, "y": 564, "pixelRatio": 2.0}, "box_white_grey_casing_8": {"width": 100, "height": 28, "x": 332, "y": 564, "pixelRatio": 2.0}, "box_white_grey_casing_9": {"width": 108, "height": 28, "x": 432, "y": 564, "pixelRatio": 2.0}, "camping_grey": {"width": 32, "height": 28, "x": 540, "y": 564, "pixelRatio": 2.0}, "hospital_grey": {"width": 28, "height": 28, "x": 572, "y": 564, "pixelRatio": 2.0}, "cave_grey": {"width": 36, "height": 26, "x": 600, "y": 564, "pixelRatio": 2.0}, "helicopter_grey": {"width": 50, "height": 26, "x": 636, "y": 564, "pixelRatio": 2.0}, "circle_circle_dark_grey_12": {"width": 24, "height": 24, "x": 686, "y": 564, "pixelRatio": 2.0}, "circle_dark_grey_12": {"width": 24, "height": 24, "x": 710, "y": 564, "pixelRatio": 2.0}, "dot_circle_dark_grey_12": {"width": 24, "height": 24, "x": 734, "y": 564, "pixelRatio": 2.0}, "circle_circle_dark_grey_10": {"width": 20, "height": 20, "x": 758, "y": 564, "pixelRatio": 2.0}, "circle_dark_grey_10": {"width": 20, "height": 20, "x": 778, "y": 564, "pixelRatio": 2.0}, "dot_circle_dark_grey_10": {"width": 20, "height": 20, "x": 798, "y": 564, "pixelRatio": 2.0}, "waterfall_blue": {"width": 12, "height": 18, "x": 818, "y": 564, "pixelRatio": 2.0}, "circle_dark_grey_8": {"width": 16, "height": 16, "x": 830, "y": 564, "pixelRatio": 2.0}, "dot_circle_dark_grey_8": {"width": 16, "height": 16, "x": 846, "y": 564, "pixelRatio": 2.0}, "dot_dark_grey_8": {"width": 16, "height": 16, "x": 862, "y": 564, "pixelRatio": 2.0}, "square_red": {"width": 14, "height": 14, "x": 878, "y": 564, "pixelRatio": 2.0}, "circle_dark_grey_6": {"width": 12, "height": 12, "x": 892, "y": 564, "pixelRatio": 2.0}, "dot_circle_dark_grey_6": {"width": 12, "height": 12, "x": 904, "y": 564, "pixelRatio": 2.0}, "dot_dark_grey_6": {"width": 12, "height": 12, "x": 916, "y": 564, "pixelRatio": 2.0}, "circle_dark_grey_4": {"width": 8, "height": 8, "x": 928, "y": 564, "pixelRatio": 2.0}, "dot_blue": {"width": 8, "height": 8, "x": 936, "y": 564, "pixelRatio": 2.0}, "dot_dark_grey_4": {"width": 8, "height": 8, "x": 944, "y": 564, "pixelRatio": 2.0}, "dot_red": {"width": 8, "height": 8, "x": 952, "y": 564, "pixelRatio": 2.0}, "dot_dark_grey_3": {"width": 6, "height": 6, "x": 960, "y": 564, "pixelRatio": 2.0}, "line_blue_long": {"width": 48, "height": 4, "x": 966, "y": 564, "pixelRatio": 2.0}, "line_blue_short": {"width": 36, "height": 4, "x": 0, "y": 592, "pixelRatio": 2.0}}
Binary file added tests/ios/__Requests__/8a8b898c51-2868.jpeg
Binary file added tests/ios/__Requests__/93c9642776-2899.jpeg
Binary file added tests/ios/__Requests__/9418299c51-2865.jpeg
Binary file added tests/ios/__Requests__/98e42bb34d-2870.jpeg
Binary file added tests/ios/__Requests__/9961cc5187-2867.jpeg
Empty file.
Binary file added tests/ios/__Requests__/abeea2486e-2871.jpeg
Binary file added tests/ios/__Requests__/b09609c52b-2871.jpeg
1 change: 1 addition & 0 deletions tests/ios/__Requests__/[email protected]

Large diffs are not rendered by default.

Binary file added tests/ios/__Requests__/b2dd29df81-2870.jpeg
Binary file added tests/ios/__Requests__/b6164598a2-2872.jpeg
Binary file added tests/ios/__Requests__/b96fa97e58-2900.jpeg
Binary file added tests/ios/__Requests__/ba484522a9-2868.jpeg
1 change: 1 addition & 0 deletions tests/ios/__Requests__/c0d5550a2f-style.json

Large diffs are not rendered by default.

Binary file added tests/ios/__Requests__/c11fe2e0e9-2898.jpeg
Binary file added tests/ios/__Requests__/c447f926ce-2868.jpeg
Binary file added tests/ios/__Requests__/c72657a67f-2865.jpeg
Binary file added tests/ios/__Requests__/c7e9702b8b-2867.jpeg
Binary file added tests/ios/__Requests__/ca489b4f4a-2899.jpeg
Binary file added tests/ios/__Requests__/caa9fae43a-2897.jpeg
Binary file added tests/ios/__Requests__/cadd002a09-2872.jpeg
Empty file.
Binary file added tests/ios/__Requests__/cca9eda243-2896.jpeg
Binary file added tests/ios/__Requests__/ccc44d40a2-2866.jpeg
Binary file added tests/ios/__Requests__/ccd140b9c3-2864.jpeg
Binary file added tests/ios/__Requests__/d114e056f0-2866.jpeg
1 change: 1 addition & 0 deletions tests/ios/__Requests__/d1a6e3a41f-style.json

Large diffs are not rendered by default.

Binary file added tests/ios/__Requests__/d252ec7c93-2872.jpeg
Binary file added tests/ios/__Requests__/d56e6bda41-2866.jpeg
Binary file added tests/ios/__Requests__/d7f67fb41e-2865.jpeg
Binary file added tests/ios/__Requests__/dd700cbca2-2864.jpeg
Binary file added tests/ios/__Requests__/e08372c5e3-2900.jpeg
Binary file added tests/ios/__Requests__/e4d10f62b6-2864.jpeg
Binary file added tests/ios/__Requests__/e5b26c4fad-2867.jpeg
Binary file added tests/ios/__Requests__/e5c079156d-2869.jpeg
Binary file added tests/ios/__Requests__/e5fb622919-2867.jpeg
Binary file added tests/ios/__Requests__/[email protected]
Binary file added tests/ios/__Requests__/e7f3e9a92b-2899.jpeg
Binary file added tests/ios/__Requests__/[email protected]
Binary file added tests/ios/__Requests__/ead64fcf6e-2902.jpeg
Binary file added tests/ios/__Requests__/f0c9ae6aa6-2872.jpeg
Binary file added tests/ios/__Requests__/f35d7cd564-2899.jpeg
Binary file added tests/ios/__Requests__/f4c95fd5d2-2869.jpeg
Binary file added tests/ios/__Requests__/f522928dab-2902.jpeg
Binary file added tests/ios/__Requests__/[email protected]
6 changes: 4 additions & 2 deletions tests/ios/helpers/FPSMetric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class FPSMetric: NSObject, XCTMetric {
}

func reportMeasurements(from startTime: XCTPerformanceMeasurementTimestamp, to endTime: XCTPerformanceMeasurementTimestamp) throws -> [XCTPerformanceMeasurement] {
let frames = self.mapView.frames.count { $0.start.absoluteTimeNanoSeconds > startTime.absoluteTimeNanoSeconds && $0.end.absoluteTimeNanoSeconds < endTime.absoluteTimeNanoSeconds }
var frames = 0
self.mapView.framesQueue.sync {
frames = self.mapView.frames.count { $0.start.absoluteTimeNanoSeconds > startTime.absoluteTimeNanoSeconds && $0.end.absoluteTimeNanoSeconds < endTime.absoluteTimeNanoSeconds }
}
let duration = Double(endTime.absoluteTimeNanoSeconds - startTime.absoluteTimeNanoSeconds) / Double(1_000_000_000)
let fps = Double(frames) / duration
return [.init(identifier: "FPS", displayName: "Frames per Second", value: .init(value: fps, unit: .init(symbol: "fps")), polarity: .prefersLarger)]
Expand All @@ -27,5 +30,4 @@ class FPSMetric: NSObject, XCTMetric {
return copy
}


}
7 changes: 5 additions & 2 deletions tests/ios/helpers/TestingMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,21 @@ class TestingMapView: MCMapView, @unchecked Sendable, MCMapReadyCallbackInterfac
}

private(set) var frames: [(start: XCTPerformanceMeasurementTimestamp, end: XCTPerformanceMeasurementTimestamp)] = []
let framesQueue = DispatchQueue(label: "FramesQueue")

override func drawFrame(in view: MTKView, completion: @escaping (CFTimeInterval?) -> Void) {
let signpostID = signposter.makeSignpostID()

let state = signposter.beginInterval(Self.signposterIntervalDraw, id: signpostID)
let start = XCTPerformanceMeasurementTimestamp()

super.drawFrame(in: view) { [signposter] in
super.drawFrame(in: view) { [signposter, weak self] in
signposter.endInterval(Self.signposterIntervalDraw, state)
completion($0)
let end = XCTPerformanceMeasurementTimestamp()
self.frames.append((start, end))
self?.framesQueue.sync {
self?.frames.append((start, end))
}
}

}
Expand Down

0 comments on commit d7e3dcf

Please sign in to comment.