diff --git a/test/runtests.jl b/test/runtests.jl index d132cbaea..57b997a8d 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -75,13 +75,15 @@ testfiles = isempty(ARGS) ? ARGS @testset "Gadfly" begin - for filename in testfiles, (backend_name, backend) in backends - @info string(filename,'.',backend_name) + for filename in testfiles Random.seed!(1) p = evalfile(joinpath(testdir, "$(filename).jl")) @test typeof(p) in [Plot,Compose.Context] - r = draw(backend(filename), p) - @test typeof(r) in [Bool,Nothing] + for (backend_name, backend) in backends + @info string(filename,'.',backend_name) + r = draw(backend(filename), p) + @test typeof(r) in [Bool,Nothing] + end end end diff --git a/test/testscripts/density_dark.jl b/test/testscripts/density_dark.jl index 59727ae77..755e28364 100644 --- a/test/testscripts/density_dark.jl +++ b/test/testscripts/density_dark.jl @@ -2,27 +2,21 @@ using Gadfly, RDatasets, Test, Base64 set_default_plot_size(6inch, 3inch) -global density_dark_tested p = Gadfly.with_theme(:dark) do plot(dataset("ggplot2", "diamonds"), x="Price", color="Cut", Geom.density) end -# prevent these tests from running more than once -if ! @isdefined density_dark_tested svg_str_dark = stringmime(MIME("image/svg+xml"), p) @test occursin(Base.hex(Gadfly.dark_theme.default_color), svg_str_dark) - @test occursin(Base.hex(Gadfly.dark_theme.background_color), svg_str_dark) - @test occursin(Base.hex(Gadfly.dark_theme.panel_fill), svg_str_dark) + @test occursin("rgba(34,40,48,1)", svg_str_dark) # dark theme background color + @test occursin("rgba(34,40,48,1)", svg_str_dark) # dark theme panel fill # Test reset. p2 = plot(dataset("ggplot2", "diamonds"), x="Price", color="Cut", Geom.density) svg_str_light = stringmime(MIME("image/svg+xml"), p2) @test !occursin(Base.hex(Gadfly.dark_theme.default_color), svg_str_light) - @test !occursin(Base.hex(Gadfly.dark_theme.background_color), svg_str_light) - @test !occursin(Base.hex(Gadfly.dark_theme.panel_fill), svg_str_light) + @test !occursin("rgba(34,40,48,1)", svg_str_light) - density_dark_tested=true -end p