PkgTemplates.jl/test/runtests.jl

37 lines
858 B
Julia
Raw Normal View History

using Base.Filesystem: path_separator
2019-08-31 10:33:33 +00:00
using Pkg: Pkg
using Random: Random
using Test: @test, @testset, @test_throws
using ReferenceTests: @test_reference
using PkgTemplates
const PT = PkgTemplates
const USER = "tester"
Random.seed!(1)
tpl(; kwargs...) = Template(; user=USER, kwargs...)
@testset "PkgTemplates.jl" begin
mktempdir() do dir
Pkg.activate(dir)
pushfirst!(DEPOT_PATH, dir)
try
include("template.jl")
2019-08-31 11:45:41 +00:00
2019-08-31 14:09:22 +00:00
# Quite a bit of output depends on the Julia version,
2019-08-31 11:45:41 +00:00
# and the test fixtures are generated with Julia 1.2.
if VERSION.major == 1 && VERSION.minor == 2
include("reference.jl")
2019-08-31 11:45:41 +00:00
else
@info "Skipping reference tests" julia=VERSION
2019-08-31 11:45:41 +00:00
end
2019-08-31 10:33:33 +00:00
finally
popfirst!(DEPOT_PATH)
end
end
end