<NME> runtests.jl
<BEF> using Test
import Documenter
include("TestUtilities.jl"); using Main.TestUtilities
# Build the example docs
include(joinpath(dirname(@__FILE__), "examples", "make.jl"))

module MissingDocs

export f
"exported"
f(x) = x

"unexported"
g(x) = x

end

# tests module
# ============
    include("missingdocs/make.jl")

    # Error reporting.
    @info "Building errors/make.jl"
    @quietly include("errors/make.jl")

    # Unit tests for module internals.
    include("except.jl")
    include("utilities.jl")
    include("remotes.jl")

    # DocChecks tests
    include("docchecks.jl")

    # NavNode tests.
    include("navnode.jl")

    # DocSystem unit tests.
    include("docsystem.jl")

    # CrossReferences
    include("crossreferences.jl")

    # DocTest unit tests.
    @info "Running tests in doctests/"
    include("doctests/docmeta.jl")
    include("doctests/doctestapi.jl")
    include("doctests/doctests.jl")
    include("doctests/fix/tests.jl")

    # DOM Tests.
    include("dom.jl")

    # MDFlatten tests.
    include("mdflatten.jl")

    # Main build pipeline (Builder and Expanders modules)
    include("pipeline.jl")

    # HTMLWriter
    include("htmlwriter.jl")

    # LaTeXWriter
    include("latexwriter.jl")

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

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

    # A simple build outside of a Git repository
    @info "Building nongit/tests.jl"
    @quietly include("nongit/tests.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

# Mock package docs:

## Missing Docs.

for sym in [:none, :exports]
    makedocs(
        root = joinpath(dirname(@__FILE__), "missingdocs"),
        source = joinpath("src", string(sym)),
        build = joinpath("build", string(sym)),
        modules = Main.MissingDocs,
        checkdocs = sym,
        format = Documenter.Formats.HTML,
        sitename = "MissingDocs Checks",
    )
end

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

# Documenter package docs:

<MSG> Move missing docs tests to a separate file

<DFF> @@ -4,16 +4,8 @@ include(joinpath(dirname(@__FILE__), "..", "docs", "make.jl"))
 # Build the example docs
 include(joinpath(dirname(@__FILE__), "examples", "make.jl"))
 
-module MissingDocs
-
-export f
-"exported"
-f(x) = x
-
-"unexported"
-g(x) = x
-
-end
+# Test missing docs
+include(joinpath(dirname(@__FILE__), "missingdocs", "make.jl"))
 
 # tests module
 # ============
@@ -284,20 +276,6 @@ println("="^50)
 
 # Mock package docs:
 
-## Missing Docs.
-
-for sym in [:none, :exports]
-    makedocs(
-        root = joinpath(dirname(@__FILE__), "missingdocs"),
-        source = joinpath("src", string(sym)),
-        build = joinpath("build", string(sym)),
-        modules = Main.MissingDocs,
-        checkdocs = sym,
-        format = Documenter.Formats.HTML,
-        sitename = "MissingDocs Checks",
-    )
-end
-
 include(joinpath(dirname(@__FILE__), "examples", "tests.jl"))
 
 # Documenter package docs:

Move missing docs tests to a separate file