File tree 2 files changed +27
-19
lines changed
2 files changed +27
-19
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,15 @@ using DynamicPPL: LogDensityFunction
3
3
@testset " Automatic differentiation" begin
4
4
# Used as the ground truth that others are compared against.
5
5
ref_adtype = AutoForwardDiff ()
6
- test_adtypes = [AutoReverseDiff (; compile= false ), AutoReverseDiff (; compile= true )]
7
6
8
- if USE_MOONCAKE
9
- push! (test_adtypes, AutoMooncake (; config= nothing ))
7
+ test_adtypes = if IS_PRERELEASE
8
+ [AutoReverseDiff (; compile= false ), AutoReverseDiff (; compile= true )]
9
+ else
10
+ [
11
+ AutoReverseDiff (; compile= false ),
12
+ AutoReverseDiff (; compile= true ),
13
+ AutoMooncake (; config= nothing ),
14
+ ]
10
15
end
11
16
12
17
@testset " Unsupported backends" begin
Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ include("test_util.jl")
41
41
42
42
# Don't attempt to import Mooncake on 1.12
43
43
# https://github.com/chalk-lab/Mooncake.jl/pull/545
44
- USE_MOONCAKE = VERSION >= v " 1.12"
44
+ IS_PRERELEASE = VERSION >= v " 1.12"
45
45
46
- if USE_MOONCAKE
46
+ if IS_PRERELEASE
47
47
Pkg. add (" Mooncake" )
48
48
using Mooncake: Mooncake
49
49
end
88
88
end
89
89
@testset " ad" begin
90
90
include (" ext/DynamicPPLForwardDiffExt.jl" )
91
- if USE_MOONCAKE
91
+ if ! IS_PRERELEASE
92
92
include (" ext/DynamicPPLMooncakeExt.jl" )
93
93
end
94
94
include (" ad.jl" )
97
97
@test_throws ErrorException prob " ..."
98
98
@test_throws ErrorException logprob " ..."
99
99
end
100
- @testset " doctests" begin
101
- DocMeta. setdocmeta! (
102
- DynamicPPL,
103
- :DocTestSetup ,
104
- :(using DynamicPPL, Distributions);
105
- recursive= true ,
106
- )
107
- doctestfilters = [
108
- # Ignore the source of a warning in the doctest output, since this is dependent on host.
109
- # This is a line that starts with "└ @ " and ends with the line number.
110
- r" └ @ .+:[0-9]+" ,
111
- ]
112
- doctest (DynamicPPL; manual= false , doctestfilters= doctestfilters)
100
+ if ! IS_PRERELEASE
101
+ # Don't run doctests on prerelease as error messages etc. may vary
102
+ @testset " doctests" begin
103
+ DocMeta. setdocmeta! (
104
+ DynamicPPL,
105
+ :DocTestSetup ,
106
+ :(using DynamicPPL, Distributions);
107
+ recursive= true ,
108
+ )
109
+ doctestfilters = [
110
+ # Ignore the source of a warning in the doctest output, since this is dependent on host.
111
+ # This is a line that starts with "└ @ " and ends with the line number.
112
+ r" └ @ .+:[0-9]+" ,
113
+ ]
114
+ doctest (DynamicPPL; manual= false , doctestfilters= doctestfilters)
115
+ end
113
116
end
114
117
end
115
118
end
You can’t perform that action at this time.
0 commit comments