From ade9d86696194828b5471e24f4d07aa0771693f1 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Thu, 4 Feb 2016 14:00:19 -0500 Subject: [PATCH] deprecated a bunch of images and docs-related stuff; cleaned up travis, imgcomp, and runtests --- .travis.yml | 8 +- .../docs}/example_generation.jl | 0 {docs => deprecated/docs}/readme_template.md | 0 {img => deprecated/img}/gadfly1.png | Bin .../img}/supported/Plots.supportGraphArgs.png | Bin .../img}/supported/Plots.supportGraphAxes.png | Bin .../supported/Plots.supportGraphMarkers.png | Bin .../supported/Plots.supportGraphScales.png | Bin .../supported/Plots.supportGraphStyles.png | Bin .../supported/Plots.supportGraphTypes.png | Bin .../img}/supported/supported.md | 0 .../test}/refimg/gadfly/ref1.png | Bin .../test}/refimg/gadfly/ref10.png | Bin .../test}/refimg/gadfly/ref11.png | Bin .../test}/refimg/gadfly/ref12.png | Bin .../test}/refimg/gadfly/ref13.png | Bin .../test}/refimg/gadfly/ref14.png | Bin .../test}/refimg/gadfly/ref15.png | Bin .../test}/refimg/gadfly/ref16.png | Bin .../test}/refimg/gadfly/ref17.png | Bin .../test}/refimg/gadfly/ref18.png | Bin .../test}/refimg/gadfly/ref2.png | Bin .../test}/refimg/gadfly/ref20.png | Bin .../test}/refimg/gadfly/ref21.png | Bin .../test}/refimg/gadfly/ref22.png | Bin .../test}/refimg/gadfly/ref3.png | Bin .../test}/refimg/gadfly/ref4.png | Bin .../test}/refimg/gadfly/ref5.png | Bin .../test}/refimg/gadfly/ref6.png | Bin .../test}/refimg/gadfly/ref7.png | Bin .../test}/refimg/gadfly/ref8.png | Bin .../test}/refimg/gadfly/ref9.png | Bin .../test}/refimg/pyplot/ref1.png | Bin .../test}/refimg/pyplot/ref10.png | Bin .../test}/refimg/pyplot/ref11.png | Bin .../test}/refimg/pyplot/ref12.png | Bin .../test}/refimg/pyplot/ref13.png | Bin .../test}/refimg/pyplot/ref14.png | Bin .../test}/refimg/pyplot/ref15.png | Bin .../test}/refimg/pyplot/ref16.png | Bin .../test}/refimg/pyplot/ref17.png | Bin .../test}/refimg/pyplot/ref18.png | Bin .../test}/refimg/pyplot/ref2.png | Bin .../test}/refimg/pyplot/ref20.png | Bin .../test}/refimg/pyplot/ref21.png | Bin .../test}/refimg/pyplot/ref22.png | Bin .../test}/refimg/pyplot/ref24.png | Bin .../test}/refimg/pyplot/ref3.png | Bin .../test}/refimg/pyplot/ref4.png | Bin .../test}/refimg/pyplot/ref5.png | Bin .../test}/refimg/pyplot/ref6.png | Bin .../test}/refimg/pyplot/ref7.png | Bin .../test}/refimg/pyplot/ref8.png | Bin .../test}/refimg/pyplot/ref9.png | Bin {test => deprecated/test}/test_plottypes.jl | 0 test/imgcomp.jl | 100 +------------- test/runtests.jl | 124 +----------------- 57 files changed, 7 insertions(+), 225 deletions(-) rename {docs => deprecated/docs}/example_generation.jl (100%) rename {docs => deprecated/docs}/readme_template.md (100%) rename {img => deprecated/img}/gadfly1.png (100%) rename {img => deprecated/img}/supported/Plots.supportGraphArgs.png (100%) rename {img => deprecated/img}/supported/Plots.supportGraphAxes.png (100%) rename {img => deprecated/img}/supported/Plots.supportGraphMarkers.png (100%) rename {img => deprecated/img}/supported/Plots.supportGraphScales.png (100%) rename {img => deprecated/img}/supported/Plots.supportGraphStyles.png (100%) rename {img => deprecated/img}/supported/Plots.supportGraphTypes.png (100%) rename {img => deprecated/img}/supported/supported.md (100%) rename {test => deprecated/test}/refimg/gadfly/ref1.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref10.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref11.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref12.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref13.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref14.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref15.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref16.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref17.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref18.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref2.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref20.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref21.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref22.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref3.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref4.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref5.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref6.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref7.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref8.png (100%) rename {test => deprecated/test}/refimg/gadfly/ref9.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref1.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref10.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref11.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref12.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref13.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref14.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref15.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref16.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref17.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref18.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref2.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref20.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref21.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref22.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref24.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref3.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref4.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref5.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref6.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref7.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref8.png (100%) rename {test => deprecated/test}/refimg/pyplot/ref9.png (100%) rename {test => deprecated/test}/test_plottypes.jl (100%) diff --git a/.travis.yml b/.travis.yml index 4663f986..b09560e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,11 +13,11 @@ script: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - julia -e 'Pkg.clone(pwd()); Pkg.build("Plots")' # - julia -e 'Pkg.clone("https://github.com/tbreloff/Images.jl.git"); Pkg.checkout("Images","tom_imgcompare");' - - julia -e 'Pkg.clone("Images"); Pkg.build("Images")' - - julia -e 'Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' + # - julia -e 'Pkg.clone("Images"); Pkg.build("Images")' + # - julia -e 'Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' - julia -e 'Pkg.clone("https://github.com/tbreloff/VisualRegressionTests.jl.git");' - julia -e 'Pkg.clone("https://github.com/tbreloff/ExamplePlots.jl.git");' - - julia -e 'Pkg.clone("Cairo"); Pkg.build("Cairo")' - - julia -e 'ENV["PYTHON"] = ""; Pkg.clone("PyPlot"); Pkg.build("PyPlot")' + # - julia -e 'Pkg.clone("Cairo"); Pkg.build("Cairo")' + # - julia -e 'ENV["PYTHON"] = ""; Pkg.clone("PyPlot"); Pkg.build("PyPlot")' - julia -e 'Pkg.test("Plots"; coverage=false)' # - julia -e 'cd(Pkg.dir("Plots")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder()); Codecov.submit(process_folder())' diff --git a/docs/example_generation.jl b/deprecated/docs/example_generation.jl similarity index 100% rename from docs/example_generation.jl rename to deprecated/docs/example_generation.jl diff --git a/docs/readme_template.md b/deprecated/docs/readme_template.md similarity index 100% rename from docs/readme_template.md rename to deprecated/docs/readme_template.md diff --git a/img/gadfly1.png b/deprecated/img/gadfly1.png similarity index 100% rename from img/gadfly1.png rename to deprecated/img/gadfly1.png diff --git a/img/supported/Plots.supportGraphArgs.png b/deprecated/img/supported/Plots.supportGraphArgs.png similarity index 100% rename from img/supported/Plots.supportGraphArgs.png rename to deprecated/img/supported/Plots.supportGraphArgs.png diff --git a/img/supported/Plots.supportGraphAxes.png b/deprecated/img/supported/Plots.supportGraphAxes.png similarity index 100% rename from img/supported/Plots.supportGraphAxes.png rename to deprecated/img/supported/Plots.supportGraphAxes.png diff --git a/img/supported/Plots.supportGraphMarkers.png b/deprecated/img/supported/Plots.supportGraphMarkers.png similarity index 100% rename from img/supported/Plots.supportGraphMarkers.png rename to deprecated/img/supported/Plots.supportGraphMarkers.png diff --git a/img/supported/Plots.supportGraphScales.png b/deprecated/img/supported/Plots.supportGraphScales.png similarity index 100% rename from img/supported/Plots.supportGraphScales.png rename to deprecated/img/supported/Plots.supportGraphScales.png diff --git a/img/supported/Plots.supportGraphStyles.png b/deprecated/img/supported/Plots.supportGraphStyles.png similarity index 100% rename from img/supported/Plots.supportGraphStyles.png rename to deprecated/img/supported/Plots.supportGraphStyles.png diff --git a/img/supported/Plots.supportGraphTypes.png b/deprecated/img/supported/Plots.supportGraphTypes.png similarity index 100% rename from img/supported/Plots.supportGraphTypes.png rename to deprecated/img/supported/Plots.supportGraphTypes.png diff --git a/img/supported/supported.md b/deprecated/img/supported/supported.md similarity index 100% rename from img/supported/supported.md rename to deprecated/img/supported/supported.md diff --git a/test/refimg/gadfly/ref1.png b/deprecated/test/refimg/gadfly/ref1.png similarity index 100% rename from test/refimg/gadfly/ref1.png rename to deprecated/test/refimg/gadfly/ref1.png diff --git a/test/refimg/gadfly/ref10.png b/deprecated/test/refimg/gadfly/ref10.png similarity index 100% rename from test/refimg/gadfly/ref10.png rename to deprecated/test/refimg/gadfly/ref10.png diff --git a/test/refimg/gadfly/ref11.png b/deprecated/test/refimg/gadfly/ref11.png similarity index 100% rename from test/refimg/gadfly/ref11.png rename to deprecated/test/refimg/gadfly/ref11.png diff --git a/test/refimg/gadfly/ref12.png b/deprecated/test/refimg/gadfly/ref12.png similarity index 100% rename from test/refimg/gadfly/ref12.png rename to deprecated/test/refimg/gadfly/ref12.png diff --git a/test/refimg/gadfly/ref13.png b/deprecated/test/refimg/gadfly/ref13.png similarity index 100% rename from test/refimg/gadfly/ref13.png rename to deprecated/test/refimg/gadfly/ref13.png diff --git a/test/refimg/gadfly/ref14.png b/deprecated/test/refimg/gadfly/ref14.png similarity index 100% rename from test/refimg/gadfly/ref14.png rename to deprecated/test/refimg/gadfly/ref14.png diff --git a/test/refimg/gadfly/ref15.png b/deprecated/test/refimg/gadfly/ref15.png similarity index 100% rename from test/refimg/gadfly/ref15.png rename to deprecated/test/refimg/gadfly/ref15.png diff --git a/test/refimg/gadfly/ref16.png b/deprecated/test/refimg/gadfly/ref16.png similarity index 100% rename from test/refimg/gadfly/ref16.png rename to deprecated/test/refimg/gadfly/ref16.png diff --git a/test/refimg/gadfly/ref17.png b/deprecated/test/refimg/gadfly/ref17.png similarity index 100% rename from test/refimg/gadfly/ref17.png rename to deprecated/test/refimg/gadfly/ref17.png diff --git a/test/refimg/gadfly/ref18.png b/deprecated/test/refimg/gadfly/ref18.png similarity index 100% rename from test/refimg/gadfly/ref18.png rename to deprecated/test/refimg/gadfly/ref18.png diff --git a/test/refimg/gadfly/ref2.png b/deprecated/test/refimg/gadfly/ref2.png similarity index 100% rename from test/refimg/gadfly/ref2.png rename to deprecated/test/refimg/gadfly/ref2.png diff --git a/test/refimg/gadfly/ref20.png b/deprecated/test/refimg/gadfly/ref20.png similarity index 100% rename from test/refimg/gadfly/ref20.png rename to deprecated/test/refimg/gadfly/ref20.png diff --git a/test/refimg/gadfly/ref21.png b/deprecated/test/refimg/gadfly/ref21.png similarity index 100% rename from test/refimg/gadfly/ref21.png rename to deprecated/test/refimg/gadfly/ref21.png diff --git a/test/refimg/gadfly/ref22.png b/deprecated/test/refimg/gadfly/ref22.png similarity index 100% rename from test/refimg/gadfly/ref22.png rename to deprecated/test/refimg/gadfly/ref22.png diff --git a/test/refimg/gadfly/ref3.png b/deprecated/test/refimg/gadfly/ref3.png similarity index 100% rename from test/refimg/gadfly/ref3.png rename to deprecated/test/refimg/gadfly/ref3.png diff --git a/test/refimg/gadfly/ref4.png b/deprecated/test/refimg/gadfly/ref4.png similarity index 100% rename from test/refimg/gadfly/ref4.png rename to deprecated/test/refimg/gadfly/ref4.png diff --git a/test/refimg/gadfly/ref5.png b/deprecated/test/refimg/gadfly/ref5.png similarity index 100% rename from test/refimg/gadfly/ref5.png rename to deprecated/test/refimg/gadfly/ref5.png diff --git a/test/refimg/gadfly/ref6.png b/deprecated/test/refimg/gadfly/ref6.png similarity index 100% rename from test/refimg/gadfly/ref6.png rename to deprecated/test/refimg/gadfly/ref6.png diff --git a/test/refimg/gadfly/ref7.png b/deprecated/test/refimg/gadfly/ref7.png similarity index 100% rename from test/refimg/gadfly/ref7.png rename to deprecated/test/refimg/gadfly/ref7.png diff --git a/test/refimg/gadfly/ref8.png b/deprecated/test/refimg/gadfly/ref8.png similarity index 100% rename from test/refimg/gadfly/ref8.png rename to deprecated/test/refimg/gadfly/ref8.png diff --git a/test/refimg/gadfly/ref9.png b/deprecated/test/refimg/gadfly/ref9.png similarity index 100% rename from test/refimg/gadfly/ref9.png rename to deprecated/test/refimg/gadfly/ref9.png diff --git a/test/refimg/pyplot/ref1.png b/deprecated/test/refimg/pyplot/ref1.png similarity index 100% rename from test/refimg/pyplot/ref1.png rename to deprecated/test/refimg/pyplot/ref1.png diff --git a/test/refimg/pyplot/ref10.png b/deprecated/test/refimg/pyplot/ref10.png similarity index 100% rename from test/refimg/pyplot/ref10.png rename to deprecated/test/refimg/pyplot/ref10.png diff --git a/test/refimg/pyplot/ref11.png b/deprecated/test/refimg/pyplot/ref11.png similarity index 100% rename from test/refimg/pyplot/ref11.png rename to deprecated/test/refimg/pyplot/ref11.png diff --git a/test/refimg/pyplot/ref12.png b/deprecated/test/refimg/pyplot/ref12.png similarity index 100% rename from test/refimg/pyplot/ref12.png rename to deprecated/test/refimg/pyplot/ref12.png diff --git a/test/refimg/pyplot/ref13.png b/deprecated/test/refimg/pyplot/ref13.png similarity index 100% rename from test/refimg/pyplot/ref13.png rename to deprecated/test/refimg/pyplot/ref13.png diff --git a/test/refimg/pyplot/ref14.png b/deprecated/test/refimg/pyplot/ref14.png similarity index 100% rename from test/refimg/pyplot/ref14.png rename to deprecated/test/refimg/pyplot/ref14.png diff --git a/test/refimg/pyplot/ref15.png b/deprecated/test/refimg/pyplot/ref15.png similarity index 100% rename from test/refimg/pyplot/ref15.png rename to deprecated/test/refimg/pyplot/ref15.png diff --git a/test/refimg/pyplot/ref16.png b/deprecated/test/refimg/pyplot/ref16.png similarity index 100% rename from test/refimg/pyplot/ref16.png rename to deprecated/test/refimg/pyplot/ref16.png diff --git a/test/refimg/pyplot/ref17.png b/deprecated/test/refimg/pyplot/ref17.png similarity index 100% rename from test/refimg/pyplot/ref17.png rename to deprecated/test/refimg/pyplot/ref17.png diff --git a/test/refimg/pyplot/ref18.png b/deprecated/test/refimg/pyplot/ref18.png similarity index 100% rename from test/refimg/pyplot/ref18.png rename to deprecated/test/refimg/pyplot/ref18.png diff --git a/test/refimg/pyplot/ref2.png b/deprecated/test/refimg/pyplot/ref2.png similarity index 100% rename from test/refimg/pyplot/ref2.png rename to deprecated/test/refimg/pyplot/ref2.png diff --git a/test/refimg/pyplot/ref20.png b/deprecated/test/refimg/pyplot/ref20.png similarity index 100% rename from test/refimg/pyplot/ref20.png rename to deprecated/test/refimg/pyplot/ref20.png diff --git a/test/refimg/pyplot/ref21.png b/deprecated/test/refimg/pyplot/ref21.png similarity index 100% rename from test/refimg/pyplot/ref21.png rename to deprecated/test/refimg/pyplot/ref21.png diff --git a/test/refimg/pyplot/ref22.png b/deprecated/test/refimg/pyplot/ref22.png similarity index 100% rename from test/refimg/pyplot/ref22.png rename to deprecated/test/refimg/pyplot/ref22.png diff --git a/test/refimg/pyplot/ref24.png b/deprecated/test/refimg/pyplot/ref24.png similarity index 100% rename from test/refimg/pyplot/ref24.png rename to deprecated/test/refimg/pyplot/ref24.png diff --git a/test/refimg/pyplot/ref3.png b/deprecated/test/refimg/pyplot/ref3.png similarity index 100% rename from test/refimg/pyplot/ref3.png rename to deprecated/test/refimg/pyplot/ref3.png diff --git a/test/refimg/pyplot/ref4.png b/deprecated/test/refimg/pyplot/ref4.png similarity index 100% rename from test/refimg/pyplot/ref4.png rename to deprecated/test/refimg/pyplot/ref4.png diff --git a/test/refimg/pyplot/ref5.png b/deprecated/test/refimg/pyplot/ref5.png similarity index 100% rename from test/refimg/pyplot/ref5.png rename to deprecated/test/refimg/pyplot/ref5.png diff --git a/test/refimg/pyplot/ref6.png b/deprecated/test/refimg/pyplot/ref6.png similarity index 100% rename from test/refimg/pyplot/ref6.png rename to deprecated/test/refimg/pyplot/ref6.png diff --git a/test/refimg/pyplot/ref7.png b/deprecated/test/refimg/pyplot/ref7.png similarity index 100% rename from test/refimg/pyplot/ref7.png rename to deprecated/test/refimg/pyplot/ref7.png diff --git a/test/refimg/pyplot/ref8.png b/deprecated/test/refimg/pyplot/ref8.png similarity index 100% rename from test/refimg/pyplot/ref8.png rename to deprecated/test/refimg/pyplot/ref8.png diff --git a/test/refimg/pyplot/ref9.png b/deprecated/test/refimg/pyplot/ref9.png similarity index 100% rename from test/refimg/pyplot/ref9.png rename to deprecated/test/refimg/pyplot/ref9.png diff --git a/test/test_plottypes.jl b/deprecated/test/test_plottypes.jl similarity index 100% rename from test/test_plottypes.jl rename to deprecated/test/test_plottypes.jl diff --git a/test/imgcomp.jl b/test/imgcomp.jl index b8c65878..85ff1266 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -1,11 +1,4 @@ -# # include this first to help with crashing?? -# try -# @eval using Gtk -# catch err -# warn("Gtk not loaded. err: $err") -# end - using VisualRegressionTests using ExamplePlots @@ -17,53 +10,10 @@ try info("Matplotlib version: $(PyPlot.matplotlib[:__version__])") end -# include("../docs/example_generation.jl") - using Plots, FactCheck -# import Images, ImageMagick -# if !isdefined(ImageMagick, :init_deps) -# function ImageMagick.init_deps() -# ccall((:MagickWandGenesis,libwand), Void, ()) -# end -# end - -# function makeImageWidget(fn) -# img = Gtk.GtkImageLeaf(fn) -# vbox = Gtk.GtkBoxLeaf(:v) -# push!(vbox, Gtk.GtkLabelLeaf(fn)) -# push!(vbox, img) -# show(img) -# vbox -# end - -# function replaceReferenceImage(tmpfn, reffn) -# cmd = `cp $tmpfn $reffn` -# run(cmd) -# info("Replaced reference image with: $cmd") -# end - -# "Show a Gtk popup with both images and a confirmation whether we should replace the new image with the old one" -# function compareToReferenceImage(tmpfn, reffn) - -# # add the images -# imgbox = Gtk.GtkBoxLeaf(:h) -# push!(imgbox, makeImageWidget(tmpfn)) -# push!(imgbox, makeImageWidget(reffn)) - -# win = Gtk.GtkWindowLeaf("Should we make this the new reference image?") -# push!(win, Gtk.GtkFrameLeaf(imgbox)) - -# showall(win) - -# # now ask the question -# if Gtk.ask_dialog("Should we make this the new reference image?", "No", "Yes") -# replaceReferenceImage(tmpfn, reffn) -# end - -# destroy(win) -# end +default(size=(500,300)) # TODO: use julia's Condition type and the wait() and notify() functions to initialize a Window, then wait() on a condition that @@ -87,18 +37,8 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = is png(fn) end - # run the example - # map(eval, PlotExamples._examples[idx].exprs) - - # # save the png - # tmpfn = tempname() * ".png" - # png(tmpfn) - - # # load the saved png - # tmpimg = Images.load(tmpfn) - # reference image directory setup - refdir = joinpath(Pkg.dir("Plots"), "test", "refimg", string(pkg)) + refdir = joinpath(Pkg.dir("ExamplePlots"), "test", "refimg", string(pkg)) try run(`mkdir -p $refdir`) catch err @@ -109,42 +49,6 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = is # the test vtest = VisualTest(func, reffn, idx) test_images(vtest, popup=popup, sigma=sigma, eps=eps) - - # try - - # # info("Comparing $tmpfn to reference $reffn") - - # # load the reference image - # refimg = Images.load(reffn) - - # # run the comparison test... a difference will throw an error - # # NOTE: sigma is a 2-length vector with x/y values for the number of pixels - # # to blur together when comparing images - # diffpct = Images.test_approx_eq_sigma_eps(tmpimg, refimg, sigma, eps) - - # # we passed! - # info("Reference image $reffn matches. Difference: $diffpct") - # return true - - # catch err - # warn("Image did not match reference image $reffn. err: $err") - # # showerror(Base.STDERR, err) - - # if isinteractive() - - # # if we're in interactive mode, open a popup and give us a chance to examine the images - # warn("Should we make this the new reference image?") - # compareToReferenceImage(tmpfn, reffn) - # # println("exited") - # return - - # else - - # # if we rejected the image, or if we're in automated tests, throw the error - # rethrow(err) - # end - - # end end function image_comparison_facts(pkg::Symbol; skip = [], debug = false, sigma = [1,1], eps = 1e-2) diff --git a/test/runtests.jl b/test/runtests.jl index 46887353..ba2b498e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,35 +1,10 @@ module PlotsTests - -# # don't let pyplot use a gui... it'll crash -# # note: Agg will set gui -> :none in PyPlot -# ENV["MPLBACKEND"] = "Agg" -# try -# @eval import PyPlot -# catch err -# warn("Couldn't import PyPlot: $err") -# end - - -# using Plots -# using FactCheck - -# # note: wrap first include in a try block because of the ImageMagick init_deps bug -# try -# include("imgcomp.jl") -# end include("imgcomp.jl") # don't actually show the plots srand(1234) default(show=false) - -# note: we wrap in a try block so that the tests only run if we have the backend installed -# try - # Pkg.installed("Gadfly") - # gadfly() - # backend() - img_eps = 5e-2 facts("Gadfly") do @@ -37,116 +12,19 @@ facts("Gadfly") do @fact backend() --> Plots.GadflyPackage() @fact typeof(plot(1:10)) --> Plots.Plot{Plots.GadflyPackage} - - # plot(x::AVec, y::AVec; kw...) # one line (will assert length(x) == length(y)) @fact plot(Int[1,2,3], rand(3)) --> not(nothing) - # @fact_throws plot(1:5, 1:4) - - # plot(x::AVec, y::AMat; kw...) # multiple lines (one per column of x), all sharing x (will assert length(x) == size(y,1)) @fact plot(sort(rand(10)), rand(Int, 10, 3)) --> not(nothing) - # @fact_throws(plot!(rand(10), rand(9,2))) - - # plot(x::AMat, y::AMat; kw...) # multiple lines (one per column of x/y... will assert size(x) == size(y)) @fact plot!(rand(10,3), rand(10,3)) --> not(nothing) image_comparison_facts(:gadfly, skip=[4,6,19,23,24], eps=img_eps) end - facts("PyPlot") do @fact pyplot() --> Plots.PyPlotPackage() @fact backend() --> Plots.PyPlotPackage() + image_comparison_facts(:pyplot, skip=[10,19,21,23], eps=img_eps) end - -# catch err -# warn("Skipped Gadfly due to: ", string(err)) -# end - -# # note: we wrap in a try block so that the tests only run if we have the backend installed -# try -# Pkg.installed("Qwt") -# qwt() -# backend() -# facts("Qwt") do -# @fact backend(:qwt) --> Plots.QwtPackage() -# @fact backend() --> Plots.QwtPackage() -# @fact typeof(plot(1:10)) --> Plots.Plot{Plots.QwtPackage} - -# # plot(y::AVec; kw...) # one line... x = 1:length(y) -# @fact plot(1:10) --> not(nothing) -# @fact length(current().o.lines) --> 1 - -# # plot(x::AVec, f::Function; kw...) # one line, y = f(x) -# @fact plot(1:10, sin) --> not(nothing) -# @fact current().o.lines[1].y --> sin(collect(1:10)) - -# # plot(x::AMat, f::Function; kw...) # multiple lines, yᵢⱼ = f(xᵢⱼ) -# @fact plot(rand(10,2), sin) --> not(nothing) -# @fact length(current().o.lines) --> 2 - -# # plot(y::AMat; kw...) # multiple lines (one per column of x), all sharing x = 1:size(y,1) -# @fact plot!(rand(10,2)) --> not(nothing) -# @fact length(current().o.lines) --> 4 - -# # plot(x::AVec, fs::AVec{Function}; kw...) # multiple lines, yᵢⱼ = fⱼ(xᵢ) -# @fact plot(1:10, Function[sin,cos]) --> not(nothing) -# @fact current().o.lines[1].y --> sin(collect(1:10)) -# @fact current().o.lines[2].y --> cos(collect(1:10)) - -# # plot(y::AVec{AVec}; kw...) # multiple lines, each with x = 1:length(y[i]) -# @fact plot([11:20 ; rand(10)]) --> not(nothing) -# @fact current().o.lines[1].x[4] --> 4 -# @fact current().o.lines[1].y[4] --> 14 -# end -# catch err -# warn("Skipped Qwt due to: ", string(err)) -# end - -# try - # Pkg.installed("PyPlot") - # pyplot() - # backend() - # facts("PyPlot") do - # @fact backend(:pyplot) --> Plots.PyPlotPackage() - # @fact backend() --> Plots.PyPlotPackage() - # @fact typeof(plot(1:10)) --> Plots.Plot{Plots.PyPlotPackage} - - # # image_comparison_facts(:pyplot, skip=[19]) - # end -# catch err -# warn("Skipped PyPlot due to: ", string(err)) -# end - - -# try -# Pkg.installed("UnicodePlots") -# unicodeplots() -# backend() -# facts("UnicodePlots") do -# @fact backend(:unicodeplots) --> Plots.UnicodePlotsPackage() -# @fact backend() --> Plots.UnicodePlotsPackage() -# @fact typeof(plot(1:10)) --> Plots.Plot{Plots.UnicodePlotsPackage} -# end -# catch err -# warn("Skipped UnicodePlots due to: ", string(err)) -# end - - -# try -# Pkg.installed("Winston") -# winston() -# backend() -# facts("Winston") do -# @fact backend(:winston) --> Plots.WinstonPackage() -# @fact backend() --> Plots.WinstonPackage() -# @fact typeof(plot(1:10)) --> Plots.Plot{Plots.WinstonPackage} -# end -# catch err -# warn("Skipped Winston due to: ", string(err)) -# end - - FactCheck.exitstatus() end # module