Skip to content

Commit d1c389d

Browse files
committed
Improve testing
1 parent b2d4e06 commit d1c389d

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

test/runtests.jl

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@ const MP = MultivariatePolynomials
55

66
include("utils.jl")
77

8-
import DynamicPolynomials
9-
Mod = DynamicPolynomials
10-
include("commutativetests.jl")
11-
include("noncommutativetests.jl")
12-
13-
import TypedPolynomials
14-
Mod = TypedPolynomials
15-
include("commutativetests.jl")
8+
# Taken from JuMP/test/solvers.jl
9+
function try_import(name::Symbol)
10+
try
11+
@eval import $name
12+
return true
13+
catch e
14+
return false
15+
end
16+
end
17+
18+
if try_import(:DynamicPolynomials)
19+
Mod = DynamicPolynomials
20+
include("commutativetests.jl")
21+
include("noncommutativetests.jl")
22+
end
23+
24+
if try_import(:TypedPolynomials)
25+
Mod = TypedPolynomials
26+
include("commutativetests.jl")
27+
end

0 commit comments

Comments
 (0)