diff --git a/.travis.yml b/.travis.yml index 66c80848..d05dcb78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ notifications: # uncomment the following lines to override the default test script script: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - julia -e 'Pkg.clone("Images"); Pkg.checkout("50872b3045600d6811b1ffba343bf75467d681c5"); Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' + - julia -e 'Pkg.clone("Images"); Pkg.checkout("Images","50872b3045600d6811b1ffba343bf75467d681c5"); Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' - julia -e 'Pkg.clone("Cairo"); Pkg.build("Cairo")' - julia -e 'Pkg.clone(pwd()); Pkg.build("Plots")' - julia -e 'Pkg.test("Plots"; coverage=true)' diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 53cd6deb..69c61807 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -2,6 +2,11 @@ # include this first to help with crashing?? using Gtk +# don't let pyplot use a gui... it'll crash +# note: Agg will set gui -> :none in PyPlot +ENV["MPLBACKEND"] = "Agg" +import PyPlot + # macro test_approx_eq_sigma_eps(A, B, sigma, eps) include("../docs/example_generation.jl") diff --git a/test/refimg/v0.4/pyplot/ref1.png b/test/refimg/v0.4/pyplot/ref1.png index ff1d4cae..3e9371db 100644 Binary files a/test/refimg/v0.4/pyplot/ref1.png and b/test/refimg/v0.4/pyplot/ref1.png differ diff --git a/test/refimg/v0.4/pyplot/ref10.png b/test/refimg/v0.4/pyplot/ref10.png new file mode 100644 index 00000000..fe3dac4d Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref10.png differ diff --git a/test/refimg/v0.4/pyplot/ref11.png b/test/refimg/v0.4/pyplot/ref11.png new file mode 100644 index 00000000..17848bde Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref11.png differ diff --git a/test/refimg/v0.4/pyplot/ref12.png b/test/refimg/v0.4/pyplot/ref12.png new file mode 100644 index 00000000..6c0accbb Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref12.png differ diff --git a/test/refimg/v0.4/pyplot/ref13.png b/test/refimg/v0.4/pyplot/ref13.png new file mode 100644 index 00000000..408b8cae Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref13.png differ diff --git a/test/refimg/v0.4/pyplot/ref14.png b/test/refimg/v0.4/pyplot/ref14.png new file mode 100644 index 00000000..af233c9f Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref14.png differ diff --git a/test/refimg/v0.4/pyplot/ref15.png b/test/refimg/v0.4/pyplot/ref15.png new file mode 100644 index 00000000..4a384e6c Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref15.png differ diff --git a/test/refimg/v0.4/pyplot/ref16.png b/test/refimg/v0.4/pyplot/ref16.png new file mode 100644 index 00000000..b483a224 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref16.png differ diff --git a/test/refimg/v0.4/pyplot/ref17.png b/test/refimg/v0.4/pyplot/ref17.png new file mode 100644 index 00000000..f5399147 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref17.png differ diff --git a/test/refimg/v0.4/pyplot/ref18.png b/test/refimg/v0.4/pyplot/ref18.png new file mode 100644 index 00000000..44cbfaa7 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref18.png differ diff --git a/test/refimg/v0.4/pyplot/ref2.png b/test/refimg/v0.4/pyplot/ref2.png new file mode 100644 index 00000000..647c50a2 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref2.png differ diff --git a/test/refimg/v0.4/pyplot/ref20.png b/test/refimg/v0.4/pyplot/ref20.png new file mode 100644 index 00000000..f156d272 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref20.png differ diff --git a/test/refimg/v0.4/pyplot/ref3.png b/test/refimg/v0.4/pyplot/ref3.png new file mode 100644 index 00000000..29abb07a Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref3.png differ diff --git a/test/refimg/v0.4/pyplot/ref4.png b/test/refimg/v0.4/pyplot/ref4.png new file mode 100644 index 00000000..f2568ed8 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref4.png differ diff --git a/test/refimg/v0.4/pyplot/ref5.png b/test/refimg/v0.4/pyplot/ref5.png new file mode 100644 index 00000000..b74d1cff Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref5.png differ diff --git a/test/refimg/v0.4/pyplot/ref6.png b/test/refimg/v0.4/pyplot/ref6.png new file mode 100644 index 00000000..90fdbaec Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref6.png differ diff --git a/test/refimg/v0.4/pyplot/ref7.png b/test/refimg/v0.4/pyplot/ref7.png new file mode 100644 index 00000000..f18616d2 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref7.png differ diff --git a/test/refimg/v0.4/pyplot/ref8.png b/test/refimg/v0.4/pyplot/ref8.png new file mode 100644 index 00000000..e2740713 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref8.png differ diff --git a/test/refimg/v0.4/pyplot/ref9.png b/test/refimg/v0.4/pyplot/ref9.png new file mode 100644 index 00000000..55175160 Binary files /dev/null and b/test/refimg/v0.4/pyplot/ref9.png differ diff --git a/test/runtests.jl b/test/runtests.jl index 88cd9f64..d787b995 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,16 @@ module PlotsTests + +# don't let pyplot use a gui... it'll crash +# note: Agg will set gui -> :none in PyPlot +try + ENV["MPLBACKEND"] = "Agg" + import PyPlot +catch err + warn("Couldn't import PyPlot: ", err) +end + + using Plots using FactCheck @@ -11,18 +22,19 @@ 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() - facts("Gadfly") do - @fact backend(:gadfly) --> Plots.GadflyPackage() - default(show=false) - @fact backend() --> Plots.GadflyPackage() - @fact typeof(plot(1:10)) --> Plots.Plot{Plots.GadflyPackage} + # Pkg.installed("Gadfly") + # gadfly() + # backend() +facts("Gadfly") do + @fact gadfly() --> Plots.GadflyPackage() + @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) @@ -37,7 +49,16 @@ srand(1234) image_comparison_tests(:gadfly, skip=[4,19], eps=1e-2) - end +end + +facts("PyPlot") do + @fact pyplot() --> Plots.PyPlotPackage() + @fact backend() --> Plots.PyPlotPackage() + image_comparison_tests(:pyplot) +end + + + # catch err # warn("Skipped Gadfly due to: ", string(err)) # end