@@ -35,12 +35,16 @@ using OrderedCollections: OrderedSet
3535
3636using DynamicPPL: getargs_dottilde, getargs_tilde, Selector
3737
38+ const GROUP = get (ENV , " GROUP" , " All" )
3839Random. seed! (100 )
3940
4041include (" test_util.jl" )
4142
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"
4448 include (" utils.jl" )
4549 include (" compiler.jl" )
4650 include (" varnamedvector.jl" )
@@ -50,15 +54,60 @@ include("test_util.jl")
5054 include (" sampler.jl" )
5155 include (" independence.jl" )
5256 include (" distribution_wrappers.jl" )
53- include (" contexts.jl" )
54- include (" context_implementations.jl" )
5557 include (" logdensityfunction.jl" )
5658 include (" linking.jl" )
57- include (" threadsafe.jl" )
5859 include (" serialization.jl" )
5960 include (" pointwise_logdensities.jl" )
6061 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" )
6168 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
62111 end
63112
64113 @testset " compat" begin
0 commit comments