Skip to content

Commit

Permalink
Merge pull request #1398 from JuliaDocs/mp/nightlytests
Browse files Browse the repository at this point in the history
Fix the nightly tests
  • Loading branch information
mortenpi authored Aug 13, 2020
2 parents 9d3beef + 0b99f6a commit faace88
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environment:
matrix:
- julia_version: 1.0
- julia_version: 1.4
- julia_version: 1.5
- julia_version: nightly

platform:
Expand Down
2 changes: 1 addition & 1 deletion test/doctests/doctests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function onormalize(s)
s = replace(s, r"(@ Documenter.DocTests )(.*)$"m => s"\1{PATH}")

# Remove stacktraces
s = replace(s, r"(│\s+Stacktrace:)(\n(│\s+)\[[0-9]+\].*)+" => s"\1\\n\3{STACKTRACE}")
s = replace(s, r"(│\s+Stacktrace:)(\n(│\s+)\[[0-9]+\].*)(\n(│\s+)@.*)?+" => s"\1\\n\3{STACKTRACE}")

return s
end
Expand Down
21 changes: 11 additions & 10 deletions test/doctests/fix/broken.jl
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
module Foo
"""
```jldoctest
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
1
2
3
4
julia> Int64[1, 2, 3, 4]
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
```
```jldoctest
julia> Int64[1, 2, 3, 4]
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
julia> Int64[1, 2, 3, 4] * 2
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
```
```jldoctest
julia> Int64[1, 2, 3, 4] * 2
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
julia> Int64[1, 2, 3, 4] * 2
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4-element Array{Int64,1}:
1
2
Expand All @@ -47,7 +48,7 @@ julia> Int64[1, 2, 3, 4] * 2
```
```jldoctest
julia> begin
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
end
4-element Array{Int64,1}:
1
Expand All @@ -56,7 +57,7 @@ julia> begin
4
```
```jldoctest
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
# output
Expand All @@ -81,7 +82,7 @@ foo() = 1
"""
```jldoctest
julia> begin
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
end
4-element Array{Int64,1}:
1
Expand Down
19 changes: 10 additions & 9 deletions test/doctests/fix/broken.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,45 @@ DocTestFixTest.Foo.foo
```

```jldoctest
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
1
2
3
4
julia> Int64[1, 2, 3, 4]
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
```
```jldoctest
julia> Int64[1, 2, 3, 4]
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
julia> Int64[1, 2, 3, 4] * 2
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
```
```jldoctest
julia> Int64[1, 2, 3, 4] * 2
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4-element Array{Int64,1}:
1
2
3
4
julia> Int64[1, 2, 3, 4] * 2
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4-element Array{Int64,1}:
1
2
Expand All @@ -49,7 +50,7 @@ julia> Int64[1, 2, 3, 4] * 2
```
```jldoctest
julia> begin
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
end
4-element Array{Int64,1}:
1
Expand All @@ -58,7 +59,7 @@ julia> begin
4
```
```jldoctest
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
# output
Expand Down
45 changes: 27 additions & 18 deletions test/doctests/fix/fixed.jl
Original file line number Diff line number Diff line change
@@ -1,66 +1,74 @@
module Foo
"""
```jldoctest
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
julia> Int64[1, 2, 3, 4]
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
1
2
3
4
```
```jldoctest
julia> Int64[1, 2, 3, 4]
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
1
2
3
4
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
```
```jldoctest
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
```
```jldoctest
julia> begin
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
end
4-element Array{Int64,1}:
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
```
```jldoctest
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
# output
4-element Array{Int64,1}:
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
Expand All @@ -83,9 +91,10 @@ foo() = 1
"""
```jldoctest
julia> begin
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
end
4-element Array{Int64,1}:
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
Expand Down
40 changes: 24 additions & 16 deletions test/doctests/fix/fixed.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,74 @@ DocTestFixTest.Foo.foo
```

```jldoctest
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
julia> Int64[1, 2, 3, 4]
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
1
2
3
4
```
```jldoctest
julia> Int64[1, 2, 3, 4]
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4], (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
1
2
3
4
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
```
```jldoctest
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
julia> Int64[1, 2, 3, 4] * 2
4-element Array{Int64,1}:
julia> reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
```
```jldoctest
julia> begin
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
end
4-element Array{Int64,1}:
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
8
```
```jldoctest
Int64[1, 2, 3, 4] * 2
reshape(Int64[1, 2, 3, 4] * 2, (4,1,1))
# output
4-element Array{Int64,1}:
4×1×1 Array{Int64,3}:
[:, :, 1] =
2
4
6
Expand Down
9 changes: 4 additions & 5 deletions test/doctests/fix/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#
# DOCUMENTER_TEST_DEBUG= JULIA_DEBUG=all julia test/doctests/fix/tests.jl
#
isdefined(@__MODULE__, :TestUtilities) || (include("../../TestUtilities.jl"); using .TestUtilities)
module DocTestFixTest
using Documenter, Test
using ..TestUtilities: @quietly

function test_doctest_fix(dir)
srcdir = mktempdir(dir)
Expand All @@ -30,15 +32,12 @@ function test_doctest_fix(dir)
@test read(joinpath(srcdir, "src.jl"), String) == read(joinpath(@__DIR__, "fixed.jl"), String)
end

println("="^50)
@info("Testing `doctest = :fix`")
@info "Testing `doctest = :fix` in $(@__FILE__)"
if haskey(ENV, "DOCUMENTER_TEST_DEBUG")
# in this mode the directories remain
test_doctest_fix(mktempdir(@__DIR__))
else
mktempdir(test_doctest_fix, @__DIR__)
@quietly mktempdir(test_doctest_fix, @__DIR__)
end
@info("Done testing `doctest = :fix`")
println("="^50)

end # module
Loading

0 comments on commit faace88

Please sign in to comment.