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