Skip to content

Commit

Permalink
Add Aqua tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lbenet committed Mar 14, 2024
1 parent d87940f commit 7ce2640
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ TaylorIntegration = "92b13dbe-c966-51a2-8445-caca9f8a7d42"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"

[compat]
Aqua = "0.8"
IntervalArithmetic = "^0.20"
IntervalRootFinding = "0.5"
LinearAlgebra = "<0.0.1, 1"
Markdown = "<0.0.1, 1"
Random = "<0.0.1, 1"
RecipesBase = "1"
Reexport = "1"
TaylorIntegration = "0.15"
Expand All @@ -27,9 +29,10 @@ Test = "<0.0.1, 1"
julia = "1"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["LinearAlgebra", "Random", "Test"]
test = ["Aqua", "LinearAlgebra", "Random", "Test"]
36 changes: 36 additions & 0 deletions test/aqua.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Test
using TaylorModels
using Aqua

@testset "Aqua tests (performance)" begin
# This tests that we don't accidentally run into
# https://github.com/JuliaLang/julia/issues/29393
# Aqua.test_unbound_args(TaylorModels)
ua = Aqua.detect_unbound_args_recursively(TaylorModels)
@test length(ua) == 0

# See: https://github.com/SciML/OrdinaryDiffEq.jl/issues/1750
# Test that we're not introducing method ambiguities across deps
ambs = Aqua.detect_ambiguities(TaylorModels; recursive = true)
pkg_match(pkgname, pkdir::Nothing) = false
pkg_match(pkgname, pkdir::AbstractString) = occursin(pkgname, pkdir)
filter!(x -> pkg_match("TaylorModels", pkgdir(last(x).module)), ambs)
for method_ambiguity in ambs
@show method_ambiguity
end
if VERSION < v"1.10.0-DEV"
@test length(ambs) == 0
end
end

@testset "Aqua tests (additional)" begin
Aqua.test_undefined_exports(TaylorModels)
Aqua.test_deps_compat(TaylorModels)
Aqua.test_stale_deps(TaylorModels)
Aqua.test_piracies(TaylorModels)
Aqua.test_unbound_args(TaylorModels)
Aqua.test_project_extras(TaylorModels)
Aqua.test_persistent_tasks(TaylorModels)
end

nothing
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ include("RTM1.jl")
include("TMN.jl")
include("shrink-wrapping.jl")
include("validated_integ.jl")
include("aqua.jl")

0 comments on commit 7ce2640

Please sign in to comment.