-
Notifications
You must be signed in to change notification settings - Fork 226
/
Copy pathruntests.jl
98 lines (80 loc) · 2.74 KB
/
runtests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
include("test_utils/SelectiveTests.jl")
using .SelectiveTests: isincluded, parse_args
using Pkg
using Random: seed!
using Test
using TimerOutputs: TimerOutputs, @timeit
import Turing
# Fix the global Random.seed for reproducibility.
seed!(23)
include(pkgdir(Turing) * "/test/test_utils/models.jl")
include(pkgdir(Turing) * "/test/test_utils/numerical_tests.jl")
include(pkgdir(Turing) * "/test/test_utils/ad_utils.jl")
Turing.setprogress!(false)
included_paths, excluded_paths = parse_args(ARGS)
# Filter which tests to run and collect timing and allocations information to show in a
# clear way.
const TIMEROUTPUT = TimerOutputs.TimerOutput()
macro timeit_include(path::AbstractString)
return quote
if isincluded($path, included_paths, excluded_paths)
@timeit TIMEROUTPUT $path include($path)
else
println("Skipping tests in $($path)")
end
end
end
@testset "Turing" begin
@testset "Test utils" begin
@timeit_include("test_utils/test_utils.jl")
end
@testset "Aqua" begin
@timeit_include("Aqua.jl")
end
@testset "essential" begin
@timeit_include("essential/ad.jl")
@timeit_include("essential/container.jl")
end
@testset "samplers (without AD)" begin
@timeit_include("mcmc/particle_mcmc.jl")
@timeit_include("mcmc/emcee.jl")
@timeit_include("mcmc/ess.jl")
@timeit_include("mcmc/is.jl")
end
@timeit TIMEROUTPUT "inference" begin
@testset "inference with samplers" begin
@timeit_include("mcmc/gibbs.jl")
@timeit_include("mcmc/gibbs_conditional.jl")
@timeit_include("mcmc/hmc.jl")
@timeit_include("mcmc/Inference.jl")
@timeit_include("mcmc/sghmc.jl")
@timeit_include("mcmc/abstractmcmc.jl")
@timeit_include("mcmc/mh.jl")
@timeit_include("ext/dynamichmc.jl")
end
@testset "variational algorithms" begin
@timeit_include("variational/advi.jl")
end
@testset "mode estimation" begin
@timeit_include("optimisation/Optimisation.jl")
@timeit_include("ext/OptimInterface.jl")
end
end
@testset "experimental" begin
@timeit_include("experimental/gibbs.jl")
end
@testset "variational optimisers" begin
@timeit_include("variational/optimisers.jl")
end
@testset "stdlib" begin
@timeit_include("stdlib/distributions.jl")
@timeit_include("stdlib/RandomMeasures.jl")
end
@testset "utilities" begin
@timeit_include("mcmc/utilities.jl")
end
@testset "extensions" begin
@timeit_include("ext/TuringMarginalLogDensitiesExt.jl")
end
end
show(TIMEROUTPUT; compact=true, sortby=:firstexec)