@@ -35,12 +35,16 @@ using OrderedCollections: OrderedSet
35
35
36
36
using DynamicPPL: getargs_dottilde, getargs_tilde, Selector
37
37
38
+ const GROUP = get (ENV , " GROUP" , " All" )
38
39
Random. seed! (100 )
39
40
40
41
include (" test_util.jl" )
41
42
42
- @testset " DynamicPPL.jl" begin
43
- @testset " interface" begin
43
+ @testset verbose = true " DynamicPPL.jl" begin
44
+ # The tests are split into two groups so that CI can run in parallel. The
45
+ # groups are chosen to make both groups take roughly the same amount of
46
+ # time, but beyond that there is no particular reason for the split.
47
+ if GROUP == " All" || GROUP == " Group1"
44
48
include (" utils.jl" )
45
49
include (" compiler.jl" )
46
50
include (" varnamedvector.jl" )
@@ -50,15 +54,60 @@ include("test_util.jl")
50
54
include (" sampler.jl" )
51
55
include (" independence.jl" )
52
56
include (" distribution_wrappers.jl" )
53
- include (" contexts.jl" )
54
- include (" context_implementations.jl" )
55
57
include (" logdensityfunction.jl" )
56
58
include (" linking.jl" )
57
- include (" threadsafe.jl" )
58
59
include (" serialization.jl" )
59
60
include (" pointwise_logdensities.jl" )
60
61
include (" lkj.jl" )
62
+ end
63
+
64
+ if GROUP == " All" || GROUP == " Group2"
65
+ include (" contexts.jl" )
66
+ include (" context_implementations.jl" )
67
+ include (" threadsafe.jl" )
61
68
include (" debug_utils.jl" )
69
+ @testset " compat" begin
70
+ include (joinpath (" compat" , " ad.jl" ))
71
+ end
72
+ @testset " extensions" begin
73
+ include (" ext/DynamicPPLMCMCChainsExt.jl" )
74
+ include (" ext/DynamicPPLJETExt.jl" )
75
+ end
76
+ @testset " ad" begin
77
+ include (" ext/DynamicPPLForwardDiffExt.jl" )
78
+ include (" ext/DynamicPPLMooncakeExt.jl" )
79
+ include (" ad.jl" )
80
+ end
81
+ @testset " prob and logprob macro" begin
82
+ @test_throws ErrorException prob " ..."
83
+ @test_throws ErrorException logprob " ..."
84
+ end
85
+ @testset " doctests" begin
86
+ DocMeta. setdocmeta! (
87
+ DynamicPPL,
88
+ :DocTestSetup ,
89
+ :(using DynamicPPL, Distributions);
90
+ recursive= true ,
91
+ )
92
+ doctestfilters = [
93
+ # Older versions will show "0 element Array" instead of "Type[]".
94
+ r" (Any\[\] |0-element Array{.+,[0-9]+})" ,
95
+ # Older versions will show "Array{...,1}" instead of "Vector{...}".
96
+ r" (Array{.+,\s ?1}|Vector{.+})" ,
97
+ # Older versions will show "Array{...,2}" instead of "Matrix{...}".
98
+ r" (Array{.+,\s ?2}|Matrix{.+})" ,
99
+ # Errors from macros sometimes result in `LoadError: LoadError:`
100
+ # rather than `LoadError:`, depending on Julia version.
101
+ r" ERROR: (LoadError:\s )+" ,
102
+ # Older versions do not have `;;]` but instead just `]` at end of the line
103
+ # => need to treat `;;]` and `]` as the same, i.e. ignore them if at the end of a line
104
+ r" (;;){0,1}\] $" m ,
105
+ # Ignore the source of a warning in the doctest output, since this is dependent on host.
106
+ # This is a line that starts with "└ @ " and ends with the line number.
107
+ r" └ @ .+:[0-9]+" ,
108
+ ]
109
+ doctest (DynamicPPL; manual= false , doctestfilters= doctestfilters)
110
+ end
62
111
end
63
112
64
113
@testset " compat" begin
0 commit comments