From 95a1f50d01be75026375304f45cd1b480c4c5571 Mon Sep 17 00:00:00 2001 From: DanielVandH Date: Thu, 9 May 2024 01:22:32 +0100 Subject: [PATCH] Reduce number of tests --- test/helper_functions/test_functions.jl | 2 +- .../coordinates/natural_coordinates.jl | 8 ++++---- test/runtests.jl | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/test/helper_functions/test_functions.jl b/test/helper_functions/test_functions.jl index 11587f1..d763572 100644 --- a/test/helper_functions/test_functions.jl +++ b/test/helper_functions/test_functions.jl @@ -223,7 +223,7 @@ end function test_interpolant(itp, x, y, f) for method in (Farin(1), :sibson, :triangle, :nearest, :laplace, Sibson(1), Hiyoshi(2)) - for _ in 1:500 + for _ in 1:25 vals = itp(x, y; parallel=false, method) vals2 = similar(vals) itp(vals2, x, y; parallel=false, method) diff --git a/test/interpolation/coordinates/natural_coordinates.jl b/test/interpolation/coordinates/natural_coordinates.jl index 7a3ab86..c6f40c0 100644 --- a/test/interpolation/coordinates/natural_coordinates.jl +++ b/test/interpolation/coordinates/natural_coordinates.jl @@ -14,7 +14,7 @@ to_mat(H) = [H[1] H[3]; H[3] H[2]] method = NNI.iwrap(method) pts = [(0.0, 8.0), (0.0, 0.0), (14.0, 0.0), (14.0, 8.0), (4.0, 4.0), (10.0, 6.0), (6.0, 2.0), (12.0, 4.0), (0.0, 4.0)] tri = triangulate(pts, randomise=false, delete_ghosts=false) - n = 2500 + n = 250 pts = random_points_in_convex_hull(tri, n) for p in Iterators.flatten((pts, DelaunayTriangulation.each_point(tri))) natural_coordinates = NNI.compute_natural_coordinates(method, tri, p) @@ -27,10 +27,10 @@ to_mat(H) = [H[1] H[3]; H[3] H[2]] end end - for _ in 1:50 + for _ in 1:5 pts = [(randn() + rand(), rand() - 2randn()) for _ in 1:250] tri = triangulate(pts, delete_ghosts=false) - n = 5000 + n = 500 random_points = random_points_in_convex_hull(tri, n) for p in Iterators.flatten((random_points, DT.each_point(tri))) natural_coordinates = NNI.compute_natural_coordinates(method, tri, p) @@ -63,7 +63,7 @@ function _circular_equality(A, B, by=isequal; kwargs...) # slightly tweaked vers end @testset "Test coefficient values for each method" begin # used GeoGebra - for _ in 1:10 # make sure rng is getting passed consistently + for _ in 1:3 # make sure rng is getting passed consistently # Setup rng = StableRNG(872973) pts = [(0.0, 8.0), (0.0, 0.0), (14.0, 0.0), diff --git a/test/runtests.jl b/test/runtests.jl index d4b0718..8bc5f89 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,58 +6,74 @@ include("jet_aqua.jl") @testset "Interpolation" begin @testset "Coordinates" begin + @info "Testing NaturalCoordinates" @safetestset "Natural Coordinates" begin include("interpolation/coordinates/natural_coordinates.jl") end + @info "Testing Utils" @safetestset "Utils" begin include("interpolation/coordinates/utils.jl") end end + @info "Testing Basic Tests" @safetestset "Basic Tests" begin include("interpolation/basic_tests.jl") end + @info "Testing Precision" @safetestset "Precision" begin include("interpolation/precision.jl") end + @info "Testing Extrapolation" @safetestset "Extrapolation" begin include("interpolation/extrapolation.jl") end + @info "Testing Structs" @safetestset "Structs" begin include("interpolation/structs.jl") end + @info "Testing Influence" @safetestset "Influence" begin include("interpolation/influence.jl") end + @info "Testing Constrained Triangulation" @safetestset "Constrained Triangulations" begin include("interpolation/constrained.jl") end end @testset "Differentiation" begin + @info "Testing Basic Tests" @safetestset "Basic Tests" begin include("differentiation/basic_tests.jl") end + @info "Testing Structs" @safetestset "Structs" begin include("differentiation/structs.jl") end + @info "Testing Utils" @safetestset "Utils" begin include("differentiation/utils.jl") end end @testset "Documentation Examples" begin + @info "Testing README Example" @safetestset "README Example" begin include("doc_examples/readme_example.jl") end + @info "Testing Interpolation Example" @safetestset "Interpolation Example" begin include("doc_examples/interpolation.jl") end + @info "Testing Differentiation Example" @safetestset "Differentiation Example" begin include("doc_examples/differentiation.jl") end + @info "Testing Interpolation Math" @safetestset "Interpolation Math" begin include("doc_examples/interpolation_math.jl") end + @info "Testing Switzerland" @safetestset "Switzerland" begin include("doc_examples/swiss.jl") end