Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better tests and testsets #260

Merged
merged 3 commits into from
Feb 14, 2025
Merged

Conversation

asinghvi17
Copy link
Member

@asinghvi17 asinghvi17 commented Feb 14, 2025

This stops the testset spam, or at least reduces it, by using context instead. @testset let ... creates a special testset that doesn't instantiate itself, meaning that each @testset_implementations is a single testset, not four testsets wearing a hoodie.

Output now looks like this:

p50 union p51 - Intersection polygons with opposite winding orders and repeated points: Test Failed at /Users/anshul/.julia/dev/geo/GeometryOps.jl/test/methods/clipping/polygon_clipping.jl:209
  Expression: compare_GO_LG_clipping(GO_f, LG_f, p1, p2)
     Context: Testing geometry from module = GeoInterface

and

 Union                                                                                                                          |  188     4    192  1.4s
    p1 union p1 - Same polygon                                                                                                   |    4            4  0.1s
    p1 union p2 - Convex polygons that intersect (diamonds, four vertices)                                                       |    4            4  0.0s
    p3 union p4 - Convex polygons that intersect (randomly generated, many edges)                                                |    4            4  0.0s
    p5 union p6 - Convex polygons that intersect (randomly generated, many edges)                                                |    4            4  0.0s
    p7 union p8 - Concave polygons that intersect (randomly generated, many edges)                                               |    4            4  0.0s
    p5 union p7 - Convex and concave polygons intersect                                                                          |    4            4  0.0s
    p9 union p10 - Figure 10 from Greiner Hormann paper                                                                          |    4            4  0.0s

which is substantially better than what we had before.

This also adds a module that densifies geoms when converting to its own geomtype (:O) so we can test the strtree stuff.

this uses the ContextTestSet from Test to reduce the amount of visual cruft.  It doesn't reduce it all the way but it can help.

Next step is to have a custom testset that can elide the excessive display.
@asinghvi17 asinghvi17 self-assigned this Feb 14, 2025
@asinghvi17 asinghvi17 requested a review from rafaqz February 14, 2025 21:05
@asinghvi17 asinghvi17 added the enhancement New feature or request label Feb 14, 2025
@asinghvi17 asinghvi17 merged commit 6aa1187 into as/non_working_do_everything Feb 14, 2025
5 of 6 checks passed
@asinghvi17 asinghvi17 deleted the as/bettertests branch February 14, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant