Skip to content

Commit

Permalink
migrate to Base.Test
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarthur committed Feb 17, 2018
1 parent 65df28d commit d249c42
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if haskey(ENV, "GADFLY_THEME")
pop!(ENV, "GADFLY_THEME")
end

using Gadfly, Compat
using Base.Test, Gadfly, Compat

repo = LibGit2.GitRepo(dirname(@__DIR__))
branch = LibGit2.headname(repo)
Expand Down Expand Up @@ -51,30 +51,27 @@ if VERSION>=v"0.6"
end

backends = Dict{AbstractString, Function}(
"svg" => (name, width, height) -> SVG(joinpath(outputdir,"$(name).svg"), width, height),
"svgjs" => (name, width, height) -> SVGJS(joinpath(outputdir,"$(name).js.svg"), width, height, jsmode=:linkabs),
"png" => (name, width, height) -> PNG(joinpath(outputdir,"$(name).png"), width, height),
#"ps" => (name, width, height) -> PS(joinpath(outputdir,"$(name).ps"), width, height),
#"pdf" => (name, width, height) -> PDF(joinpath(outputdir,"$(name).pdf"), width, height)
"pgf" => (name, width, height) -> PGF(joinpath(outputdir,"$(name).tex"), width, height)
"svg" => name -> SVG(joinpath(outputdir,"$(name).svg")),
"svgjs" => name -> SVGJS(joinpath(outputdir,"$(name).js.svg"), jsmode=:linkabs),
"png" => name -> PNG(joinpath(outputdir,"$(name).png")),
"ps" => name -> PS(joinpath(outputdir,"$(name).ps")),
"pdf" => name -> PDF(joinpath(outputdir,"$(name).pdf")),
"pgf" => name -> PGF(joinpath(outputdir,"$(name).tex"))

This comment has been minimized.

Copy link
@non-Jedi

non-Jedi Mar 16, 2018

Contributor

I can't run tests locally until Compose.jl has another release because of this. GiovineItalia/Compose.jl#278 hasn't made it into a release yet.

This comment has been minimized.

Copy link
@bjarthur

bjarthur Mar 16, 2018

Author Member

gadfly and compose are so tightly coupled that when developing gadfly you should have compose master checked out. notice that this is done in gadfly's .travis.yml.

)

testdir = joinpath((@__DIR__),"testscripts")
testfiles = isempty(ARGS) ?
[splitext(filename)[1] for filename in readdir(testdir) if filename[1]!='.'] :
ARGS

for filename in testfiles, (backend_name, backend) in backends
println(STDERR, "Rendering $(filename) on $(backend_name) backend.")
try
@testset "Gadfly" begin
for filename in testfiles, (backend_name, backend) in backends
info(filename,'.',backend_name)
srand(1)
p = evalfile(joinpath(testdir, "$(filename).jl"))
width = Compose.default_graphic_width
height = Compose.default_graphic_height
@time eval(Expr(:call, ()->draw(backend(filename, width, height), p) ))
catch
println(STDERR, "FAILED!")
rethrow()
@test typeof(p) in [Plot,Compose.Context]
r = draw(backend(filename), p)
@test typeof(r) in [Bool,Void]
end
end

Expand Down

1 comment on commit d249c42

@tlnagy
Copy link
Member

@tlnagy tlnagy commented on d249c42 Mar 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this change? We don't take advantage of the nice formatting because we're not using the @test command.

Please sign in to comment.