Skip to content

Commit e2317a4

Browse files
committed
print more on screen when testing
1 parent 25366bc commit e2317a4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/runtests.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,19 @@ norm_val = ones(dim)
1919
alpha = ones(4)
2020
dir_val = fill(0.25, 4)
2121
beta_mat = rand(MatrixBeta(dim, dim, dim))
22+
tested = []
23+
function test_info(name)
24+
if !(name in tested)
25+
push!(tested, name)
26+
@info("Testing: $(name)")
27+
end
28+
end
29+
test_head(s) = println("\n"*s*"\n")
30+
separator() = println("\n"*"="^50)
2231

32+
separator()
2333
@testset "Univariate discrete distributions" begin
34+
test_head("Testing: Univariate discrete distributions")
2435
uni_disc_dists = [
2536
DistSpec(:Bernoulli, (0.45,), 1),
2637
DistSpec(:Bernoulli, (0.45,), 0),
@@ -34,13 +45,16 @@ beta_mat = rand(MatrixBeta(dim, dim, dim))
3445
DistSpec(:PoissonBinomial, ([0.5, 0.5],), 0),
3546
]
3647
for d in uni_disc_dists
48+
test_info(d.name)
3749
for testf in get_all_functions(d, false)
3850
test_ad(testf.f, testf.x)
3951
end
4052
end
4153
end
54+
separator()
4255

4356
@testset "Univariate continuous distributions" begin
57+
test_head("Testing: Univariate continuous distributions")
4458
uni_cont_dists = [
4559
DistSpec(:Arcsine, (), 0.5),
4660
DistSpec(:Arcsine, (1,), 0.5),
@@ -145,27 +159,33 @@ end
145159
DistSpec(:VonMises, (1, 1), 1),
146160
]
147161
for d in uni_cont_dists
162+
test_info(d.name)
148163
for testf in get_all_functions(d, true)
149164
test_ad(testf.f, testf.x)
150165
end
151166
end
152167
end
168+
separator()
153169

154170
@testset "Multivariate discrete distributions" begin
171+
test_head("Testing: Multivariate discrete distributions")
155172
mult_disc_dists = [
156173
]
157174
broken_mult_disc_dists = [
158175
# Dispatch error caused by lack of type parameters in Distributions.Multinomial
159176
DistSpec(:((p) -> Multinomial(4, p)), (fill(0.25, 4),), 1),
160177
]
161178
for d in mult_disc_dists
179+
test_info(d.name)
162180
for testf in get_all_functions(d, false)
163181
test_ad(testf.f, testf.x)
164182
end
165183
end
166184
end
185+
separator()
167186

168187
@testset "Multivariate continuous distributions" begin
188+
test_head("Testing: Multivariate continuous distributions")
169189
mult_cont_dists = [
170190
DistSpec(:MvNormal, (mean, cov_mat), norm_val),
171191
DistSpec(:MvNormal, (mean, cov_vec), norm_val),
@@ -195,13 +215,16 @@ end
195215
]
196216

197217
for d in mult_cont_dists
218+
test_info(d.name)
198219
for testf in get_all_functions(d, true)
199220
test_ad(testf.f, testf.x)
200221
end
201222
end
202223
end
224+
separator()
203225

204226
@testset "Matrix-variate continuous distributions" begin
227+
test_head("Testing: Matrix-variate continuous distributions")
205228
matrix_cont_dists = [
206229
DistSpec(:((n1, n2)->MatrixBeta(dim, n1, n2)), (dim, dim), beta_mat),
207230
]
@@ -215,8 +238,10 @@ end
215238
]
216239

217240
for d in matrix_cont_dists
241+
test_info(d.name)
218242
for testf in get_all_functions(d, true)
219243
test_ad(testf.f, testf.x)
220244
end
221245
end
222246
end
247+
separator()

0 commit comments

Comments
 (0)