From 4d929247bd95a4dfbbb31fce41a5659b0949234d Mon Sep 17 00:00:00 2001 From: schillic Date: Sat, 8 Apr 2023 20:33:22 +0200 Subject: [PATCH] better test for package version --- test/LazyOperations/Intersection.jl | 4 +--- test/Project.toml | 5 +++-- test/runtests.jl | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/LazyOperations/Intersection.jl b/test/LazyOperations/Intersection.jl index 5e44d9a0c6..0af8a3e3d5 100644 --- a/test/LazyOperations/Intersection.jl +++ b/test/LazyOperations/Intersection.jl @@ -26,9 +26,7 @@ for N in [Float64, Rational{Int}, Float32] I2 = Hyperplane(ones(N, 2), N(1)) ∩ HalfSpace(ones(N, 2), N(1)) # the next test fails with the "EXACT" solver GLPK older than v0.15.3 # see https://github.com/jump-dev/GLPK.jl/issues/207 - mf = Pkg.Operations.Context().env.manifest - ver = mf[findfirst(v -> v.name == "GLPK", mf)].version - if N != Rational{Int} || ver >= v"0.15.3" + if N != Rational{Int} || PkgVersion.Version(LazySets.GLPK) >= v"0.15.3" @test !isbounded(I2) && !isboundedtype(typeof(I2)) end diff --git a/test/Project.toml b/test/Project.toml index fa346b360f..cede92765a 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -14,7 +14,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" MiniQhull = "978d7f02-9e05-4691-894f-ae31a51d76ca" Optim = "429524aa-4258-5aef-a3af-852621145aeb" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +PkgVersion = "eebad327-c553-4316-9ea0-9fa01ccd7688" Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RangeEnclosures = "1b4d18b6-9e5d-11e9-236c-f792b01831f8" @@ -34,13 +34,14 @@ Expokit = "0.2" ExponentialUtilities = "1" GR = "0" IntervalArithmetic = "0.15 - 0.20" -Ipopt = "1" # IntervalConstraintProgramming = "0.9 - 0.12" IntervalMatrices = "0.8" +Ipopt = "1" Javis = "0.5 - 0.9" Makie = "0.9 - 0.19" MiniQhull = "0.1 - 0.4" Optim = "0.15 - 0.22, 1" +PkgVersion = "0.3" Polyhedra = "0.6 - 0.7" RangeEnclosures = "0.1.1" RecipesBase = "0.6 - 0.8, 1" diff --git a/test/runtests.jl b/test/runtests.jl index 65fb33a739..1d9dfd4078 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -8,8 +8,8 @@ Random.seed!(1234) # ======================== # Optional dependencies # ======================== -import Distributions, ExponentialUtilities, Expokit, - IntervalMatrices, Ipopt, Optim, Pkg, TaylorModels, RangeEnclosures +import Distributions, ExponentialUtilities, Expokit, IntervalMatrices, Ipopt, + Optim, PkgVersion, TaylorModels, RangeEnclosures import IntervalArithmetic as IA using IntervalArithmetic: IntervalBox using IntervalMatrices: ±, IntervalMatrix