<NME> runtests.jl
<BEF> using Test
import Documenter
include("TestUtilities.jl"); using Main.TestUtilities

@testset "Documenter" begin
    # Build the example docs
# Test missing docs
include(joinpath(dirname(@__FILE__), "missingdocs", "make.jl"))

# tests module
# ============

module Tests

using Documenter
using Base.Test
using Compat


# Unit tests for module internals.

include("utilities.jl")

## NavNode tests

include("navnode.jl")

# DocSystem unit tests.

include("docsystem.jl")

## DOM Tests.

include("dom.jl")

# `Markdown.MD` to `DOM.Node` conversion tests.
module MarkdownToNode
    import Documenter.DocSystem
    import Documenter.Writers.HTMLWriter: mdconvert

    # Deployment configurations
    include("deployconfig.jl")
    include("deploydocs.jl")

    # Mock package docs.
    include("examples/tests.jl")

        end
    end
end

# Integration tests for module api.

# Error reporting.

println("="^50)
info("The following errors are expected output.")
include(joinpath("errors", "make.jl"))
info("END of expected error output.")
println("="^50)

# Mock package docs:

include(joinpath(dirname(@__FILE__), "examples", "tests.jl"))

# Documenter package docs with other formats

include("formats/markdown.jl")
include("formats/latex.jl")

end

# more tests from files
include("mdflatten.jl")

    # A simple build evaluating code outside build directory
    @info "Building workdir/tests.jl"
    @quietly include("workdir/tests.jl")

    # Passing a writer positionally (https://github.com/JuliaDocs/Documenter.jl/issues/1046)
    @test_throws ArgumentError makedocs(sitename="", HTML())

    # Running doctest() on our own manual
    @info "doctest() Documenter's manual"
    @quietly include("manual.jl")
end

<MSG> Use testsets in runtests.jl

And otherwise reorganize the file a bit.

Fixes #154.

<DFF> @@ -7,33 +7,49 @@ include(joinpath(dirname(@__FILE__), "examples", "make.jl"))
 # Test missing docs
 include(joinpath(dirname(@__FILE__), "missingdocs", "make.jl"))
 
-# tests module
-# ============
-
-module Tests
+# Error reporting.
+println("="^50)
+info("The following errors are expected output.")
+include(joinpath("errors", "make.jl"))
+info("END of expected error output.")
+println("="^50)
 
-using Documenter
-using Base.Test
-using Compat
+# Primary @testset
 
+if VERSION >= v"0.5.0-dev+7720"
+    using Base.Test
+else
+    using BaseTestNext
+    const Test = BaseTestNext
+end
 
-# Unit tests for module internals.
+@testset "Documenter" begin
+    # Unit tests for module internals.
+    include("utilities.jl")
 
-include("utilities.jl")
+    # NavNode tests.
+    include("navnode.jl")
 
-## NavNode tests
+    # DocSystem unit tests.
+    include("docsystem.jl")
 
-include("navnode.jl")
+    # DOM Tests.
+    include("dom.jl")
 
-# DocSystem unit tests.
+    # MDFlatten tests.
+    include("mdflatten.jl")
 
-include("docsystem.jl")
+    # Mock package docs.
+    include("examples/tests.jl")
 
-## DOM Tests.
+    # Documenter package docs with other formats.
+    include("formats/markdown.jl")
+    include("formats/latex.jl")
+end
 
-include("dom.jl")
+# Additional tests
 
-# `Markdown.MD` to `DOM.Node` conversion tests.
+## `Markdown.MD` to `DOM.Node` conversion tests.
 module MarkdownToNode
     import Documenter.DocSystem
     import Documenter.Writers.HTMLWriter: mdconvert
@@ -48,27 +64,3 @@ module MarkdownToNode
         end
     end
 end
-
-# Integration tests for module api.
-
-# Error reporting.
-
-println("="^50)
-info("The following errors are expected output.")
-include(joinpath("errors", "make.jl"))
-info("END of expected error output.")
-println("="^50)
-
-# Mock package docs:
-
-include(joinpath(dirname(@__FILE__), "examples", "tests.jl"))
-
-# Documenter package docs with other formats
-
-include("formats/markdown.jl")
-include("formats/latex.jl")
-
-end
-
-# more tests from files
-include("mdflatten.jl")

Use testsets in runtests.jl