@@ -45,98 +45,98 @@ include("test_util.jl")
4545
4646@testset " DynamicPPL.jl" begin
4747 if GROUP == " All" || GROUP == " DynamicPPL"
48- # @testset "interface" begin
49- # include("utils.jl")
50- # include("compiler.jl")
51- # include("varnamedvector.jl")
52- # include("varinfo.jl")
53- # include("simple_varinfo.jl")
54- # include("model.jl")
55- # include("sampler.jl")
56- # include("independence.jl")
57- # include("distribution_wrappers.jl")
58- # include("contexts.jl")
59- # include("context_implementations.jl")
60- # include("logdensityfunction.jl")
61- # include("linking.jl")
62-
63- # include("threadsafe.jl")
64-
65- # include("serialization.jl")
66-
67- # include("pointwise_logdensities.jl")
68-
69- # include("lkj.jl")
70-
71- # include("debug_utils.jl")
72- # end
48+ @testset " interface" begin
49+ include (" utils.jl" )
50+ include (" compiler.jl" )
51+ include (" varnamedvector.jl" )
52+ include (" varinfo.jl" )
53+ include (" simple_varinfo.jl" )
54+ include (" model.jl" )
55+ include (" sampler.jl" )
56+ include (" independence.jl" )
57+ include (" distribution_wrappers.jl" )
58+ include (" contexts.jl" )
59+ include (" context_implementations.jl" )
60+ include (" logdensityfunction.jl" )
61+ include (" linking.jl" )
62+
63+ include (" threadsafe.jl" )
64+
65+ include (" serialization.jl" )
66+
67+ include (" pointwise_logdensities.jl" )
68+
69+ include (" lkj.jl" )
70+
71+ include (" debug_utils.jl" )
72+ end
7373
74- # @testset "compat" begin
75- # include(joinpath("compat", "ad.jl"))
76- # end
74+ @testset " compat" begin
75+ include (joinpath (" compat" , " ad.jl" ))
76+ end
7777
7878 @testset " extensions" begin
7979 include (" ext/DynamicPPLMCMCChainsExt.jl" )
8080 include (" ext/DynamicPPLJETExt.jl" )
8181 end
8282
83- # @testset "ad" begin
84- # include("ext/DynamicPPLForwardDiffExt.jl")
85- # include("ad.jl")
86- # end
87-
88- # @testset "prob and logprob macro" begin
89- # @test_throws ErrorException prob"..."
90- # @test_throws ErrorException logprob"..."
91- # end
92-
93- # @testset "doctests" begin
94- # DocMeta.setdocmeta!(
95- # DynamicPPL,
96- # :DocTestSetup,
97- # :(using DynamicPPL, Distributions);
98- # recursive=true,
99- # )
100- # doctestfilters = [
101- # # Older versions will show "0 element Array" instead of "Type[]".
102- # r"(Any\[\]|0-element Array{.+,[0-9]+})",
103- # # Older versions will show "Array{...,1}" instead of "Vector{...}".
104- # r"(Array{.+,\s?1}|Vector{.+})",
105- # # Older versions will show "Array{...,2}" instead of "Matrix{...}".
106- # r"(Array{.+,\s?2}|Matrix{.+})",
107- # # Errors from macros sometimes result in `LoadError: LoadError:`
108- # # rather than `LoadError:`, depending on Julia version.
109- # r"ERROR: (LoadError:\s)+",
110- # # Older versions do not have `;;]` but instead just `]` at end of the line
111- # # => need to treat `;;]` and `]` as the same, i.e. ignore them if at the end of a line
112- # r"(;;){0,1}\]$"m,
113- # ]
114- # doctest(DynamicPPL; manual=false, doctestfilters=doctestfilters)
115- # end
83+ @testset " ad" begin
84+ include (" ext/DynamicPPLForwardDiffExt.jl" )
85+ include (" ad.jl" )
86+ end
87+
88+ @testset " prob and logprob macro" begin
89+ @test_throws ErrorException prob " ..."
90+ @test_throws ErrorException logprob " ..."
91+ end
92+
93+ @testset " doctests" begin
94+ DocMeta. setdocmeta! (
95+ DynamicPPL,
96+ :DocTestSetup ,
97+ :(using DynamicPPL, Distributions);
98+ recursive= true ,
99+ )
100+ doctestfilters = [
101+ # Older versions will show "0 element Array" instead of "Type[]".
102+ r" (Any\[\] |0-element Array{.+,[0-9]+})" ,
103+ # Older versions will show "Array{...,1}" instead of "Vector{...}".
104+ r" (Array{.+,\s ?1}|Vector{.+})" ,
105+ # Older versions will show "Array{...,2}" instead of "Matrix{...}".
106+ r" (Array{.+,\s ?2}|Matrix{.+})" ,
107+ # Errors from macros sometimes result in `LoadError: LoadError:`
108+ # rather than `LoadError:`, depending on Julia version.
109+ r" ERROR: (LoadError:\s )+" ,
110+ # Older versions do not have `;;]` but instead just `]` at end of the line
111+ # => need to treat `;;]` and `]` as the same, i.e. ignore them if at the end of a line
112+ r" (;;){0,1}\] $" m ,
113+ ]
114+ doctest (DynamicPPL; manual= false , doctestfilters= doctestfilters)
115+ end
116116 end
117117
118- # if GROUP == "All" || GROUP == "Downstream"
119- # @testset "turing" begin
120- # try
121- # # activate separate test environment
122- # Pkg.activate(DIRECTORY_Turing_tests)
123- # Pkg.develop(PackageSpec(; path=DIRECTORY_DynamicPPL))
124- # Pkg.instantiate()
125-
126- # # make sure that the new environment is considered `using` and `import` statements
127- # # (not added automatically on Julia 1.3, see e.g. PR #209)
128- # if !(joinpath(DIRECTORY_Turing_tests, "Project.toml") in Base.load_path())
129- # pushfirst!(LOAD_PATH, DIRECTORY_Turing_tests)
130- # end
131-
132- # include(joinpath("turing", "runtests.jl"))
133- # catch err
134- # err isa Pkg.Resolve.ResolverError || rethrow()
135- # # If we can't resolve that means this is incompatible by SemVer and this is fine
136- # # It means we marked this as a breaking change, so we don't need to worry about
137- # # Mistakenly introducing a breaking change, as we have intentionally made one
138- # @info "Not compatible with this release. No problem." exception = err
139- # end
140- # end
141- # end
118+ if GROUP == " All" || GROUP == " Downstream"
119+ @testset " turing" begin
120+ try
121+ # activate separate test environment
122+ Pkg. activate (DIRECTORY_Turing_tests)
123+ Pkg. develop (PackageSpec (; path= DIRECTORY_DynamicPPL))
124+ Pkg. instantiate ()
125+
126+ # make sure that the new environment is considered `using` and `import` statements
127+ # (not added automatically on Julia 1.3, see e.g. PR #209)
128+ if ! (joinpath (DIRECTORY_Turing_tests, " Project.toml" ) in Base. load_path ())
129+ pushfirst! (LOAD_PATH , DIRECTORY_Turing_tests)
130+ end
131+
132+ include (joinpath (" turing" , " runtests.jl" ))
133+ catch err
134+ err isa Pkg. Resolve. ResolverError || rethrow ()
135+ # If we can't resolve that means this is incompatible by SemVer and this is fine
136+ # It means we marked this as a breaking change, so we don't need to worry about
137+ # Mistakenly introducing a breaking change, as we have intentionally made one
138+ @info " Not compatible with this release. No problem." exception = err
139+ end
140+ end
141+ end
142142end
0 commit comments