Skip to content

Commit d77b7ae

Browse files
committed
runtests: more robust examples_path
1 parent 70302d1 commit d77b7ae

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/runtests.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
using Sundials
22
using Base.Test
33

4+
examples_path = joinpath(dirname(@__FILE__), "..", "examples")
5+
46
# run cvode example
57
println("== start cvode Roberts example (simplified)")
6-
include("../examples/cvode_Roberts_simplified.jl")
8+
include(joinpath(examples_path, "cvode_Roberts_simplified.jl"))
79

810
println("result at t=$(t[end]):")
911
println(res[end,:], "\n")
1012

1113
println("== start cvode Roberts example")
12-
include("../examples/cvode_Roberts_dns.jl")
14+
include(joinpath(examples_path, "cvode_Roberts_dns.jl"))
1315

1416
# run ida examples
1517
println("== start ida_Roberts example (simplified)")
16-
include("../examples/ida_Roberts_simplified.jl")
18+
include(joinpath(examples_path, "ida_Roberts_simplified.jl"))
1719

1820
println("== start ida_Roberts example")
19-
include("../examples/ida_Roberts_dns.jl")
21+
include(joinpath(examples_path, "ida_Roberts_dns.jl"))
2022

2123
println("result at t=$(t[end]):")
2224
println(yout[end,:], "\n")
2325

2426
println("== start ida_Heat2D example")
25-
include("../examples/ida_Heat2D.jl")
27+
include(joinpath(examples_path, "ida_Heat2D.jl"))
2628

2729
println("result at t=$(t[end]):")
2830
println(yout[end,:], "\n")
2931

3032
# run kinsol example
3133
println("== start kinsol example (simplified)")
32-
include("../examples/kinsol_mkin_simplified.jl")
34+
include(joinpath(examples_path, "kinsol_mkin_simplified.jl"))
3335

3436
println("solution:")
3537
println(res)
@@ -39,6 +41,6 @@ println("residual:")
3941
println(residual, "\n")
4042

4143
println("== start kinsol example")
42-
include("../examples/kinsol_mkinTest.jl")
44+
include(joinpath(examples_path, "kinsol_mkinTest.jl"))
4345

4446
@test abs(minimum(residual)) < 1e-5

0 commit comments

Comments
 (0)