@@ -29,107 +29,76 @@ using Combinatorics: combinations
2929
3030using DynamicPPL: getargs_dottilde, getargs_tilde, Selector
3131
32- const DIRECTORY_DynamicPPL = dirname (dirname (pathof (DynamicPPL)))
33- const DIRECTORY_Turing_tests = joinpath (DIRECTORY_DynamicPPL, " test" , " turing" )
34- const GROUP = get (ENV , " GROUP" , " All" )
35-
3632Random. seed! (100 )
3733
3834include (" test_util.jl" )
3935
4036@testset " DynamicPPL.jl" begin
41- if GROUP == " All" || GROUP == " DynamicPPL"
42- @testset " interface" begin
43- include (" utils.jl" )
44- include (" compiler.jl" )
45- include (" varnamedvector.jl" )
46- include (" varinfo.jl" )
47- include (" simple_varinfo.jl" )
48- include (" model.jl" )
49- include (" sampler.jl" )
50- include (" independence.jl" )
51- include (" distribution_wrappers.jl" )
52- include (" contexts.jl" )
53- include (" context_implementations.jl" )
54- include (" logdensityfunction.jl" )
55- include (" linking.jl" )
56-
57- include (" threadsafe.jl" )
58-
59- include (" serialization.jl" )
60-
61- include (" pointwise_logdensities.jl" )
62-
63- include (" lkj.jl" )
64-
65- include (" debug_utils.jl" )
66- end
67-
68- @testset " compat" begin
69- include (joinpath (" compat" , " ad.jl" ))
70- end
71-
72- @testset " extensions" begin
73- include (" ext/DynamicPPLMCMCChainsExt.jl" )
74- end
75-
76- @testset " ad" begin
77- include (" ext/DynamicPPLForwardDiffExt.jl" )
78- include (" ad.jl" )
79- end
80-
81- @testset " prob and logprob macro" begin
82- @test_throws ErrorException prob " ..."
83- @test_throws ErrorException logprob " ..."
84- end
85-
86- @testset " doctests" begin
87- DocMeta. setdocmeta! (
88- DynamicPPL,
89- :DocTestSetup ,
90- :(using DynamicPPL, Distributions);
91- recursive= true ,
92- )
93- doctestfilters = [
94- # Older versions will show "0 element Array" instead of "Type[]".
95- r" (Any\[\] |0-element Array{.+,[0-9]+})" ,
96- # Older versions will show "Array{...,1}" instead of "Vector{...}".
97- r" (Array{.+,\s ?1}|Vector{.+})" ,
98- # Older versions will show "Array{...,2}" instead of "Matrix{...}".
99- r" (Array{.+,\s ?2}|Matrix{.+})" ,
100- # Errors from macros sometimes result in `LoadError: LoadError:`
101- # rather than `LoadError:`, depending on Julia version.
102- r" ERROR: (LoadError:\s )+" ,
103- # Older versions do not have `;;]` but instead just `]` at end of the line
104- # => need to treat `;;]` and `]` as the same, i.e. ignore them if at the end of a line
105- r" (;;){0,1}\] $" m ,
106- ]
107- doctest (DynamicPPL; manual= false , doctestfilters= doctestfilters)
108- end
37+ @testset " interface" begin
38+ include (" utils.jl" )
39+ include (" compiler.jl" )
40+ include (" varnamedvector.jl" )
41+ include (" varinfo.jl" )
42+ include (" simple_varinfo.jl" )
43+ include (" model.jl" )
44+ include (" sampler.jl" )
45+ include (" independence.jl" )
46+ include (" distribution_wrappers.jl" )
47+ include (" contexts.jl" )
48+ include (" context_implementations.jl" )
49+ include (" logdensityfunction.jl" )
50+ include (" linking.jl" )
51+
52+ include (" threadsafe.jl" )
53+
54+ include (" serialization.jl" )
55+
56+ include (" pointwise_logdensities.jl" )
57+
58+ include (" lkj.jl" )
59+
60+ include (" debug_utils.jl" )
61+ end
62+
63+ @testset " compat" begin
64+ include (joinpath (" compat" , " ad.jl" ))
65+ end
66+
67+ @testset " extensions" begin
68+ include (" ext/DynamicPPLMCMCChainsExt.jl" )
69+ end
70+
71+ @testset " ad" begin
72+ include (" ext/DynamicPPLForwardDiffExt.jl" )
73+ include (" ad.jl" )
74+ end
75+
76+ @testset " prob and logprob macro" begin
77+ @test_throws ErrorException prob " ..."
78+ @test_throws ErrorException logprob " ..."
10979 end
11080
111- if GROUP == " All" || GROUP == " Downstream"
112- @testset " turing" begin
113- try
114- # activate separate test environment
115- Pkg. activate (DIRECTORY_Turing_tests)
116- Pkg. develop (PackageSpec (; path= DIRECTORY_DynamicPPL))
117- Pkg. instantiate ()
118-
119- # make sure that the new environment is considered `using` and `import` statements
120- # (not added automatically on Julia 1.3, see e.g. PR #209)
121- if ! (joinpath (DIRECTORY_Turing_tests, " Project.toml" ) in Base. load_path ())
122- pushfirst! (LOAD_PATH , DIRECTORY_Turing_tests)
123- end
124-
125- include (joinpath (" turing" , " runtests.jl" ))
126- catch err
127- err isa Pkg. Resolve. ResolverError || rethrow ()
128- # If we can't resolve that means this is incompatible by SemVer and this is fine
129- # It means we marked this as a breaking change, so we don't need to worry about
130- # Mistakenly introducing a breaking change, as we have intentionally made one
131- @info " Not compatible with this release. No problem." exception = err
132- end
133- end
81+ @testset " doctests" begin
82+ DocMeta. setdocmeta! (
83+ DynamicPPL,
84+ :DocTestSetup ,
85+ :(using DynamicPPL, Distributions);
86+ recursive= true ,
87+ )
88+ doctestfilters = [
89+ # Older versions will show "0 element Array" instead of "Type[]".
90+ r" (Any\[\] |0-element Array{.+,[0-9]+})" ,
91+ # Older versions will show "Array{...,1}" instead of "Vector{...}".
92+ r" (Array{.+,\s ?1}|Vector{.+})" ,
93+ # Older versions will show "Array{...,2}" instead of "Matrix{...}".
94+ r" (Array{.+,\s ?2}|Matrix{.+})" ,
95+ # Errors from macros sometimes result in `LoadError: LoadError:`
96+ # rather than `LoadError:`, depending on Julia version.
97+ r" ERROR: (LoadError:\s )+" ,
98+ # Older versions do not have `;;]` but instead just `]` at end of the line
99+ # => need to treat `;;]` and `]` as the same, i.e. ignore them if at the end of a line
100+ r" (;;){0,1}\] $" m ,
101+ ]
102+ doctest (DynamicPPL; manual= false , doctestfilters= doctestfilters)
134103 end
135104end
0 commit comments