diff --git a/.travis.yml b/.travis.yml index fb9a97a2..31817d0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,10 +43,10 @@ before_install: notifications: email: true # uncomment the following lines to override the default test script -script: - - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - julia -e 'import Pkg; Pkg.add(Pkg.PackageSpec(path=pwd())); Pkg.build("Plots")' - - julia test/travis_commands.jl +# script: + # - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi + # - julia -e 'import Pkg; Pkg.add(Pkg.PackageSpec(path=pwd())); Pkg.build("Plots")' + # - julia test/travis_commands.jl # - julia -e 'Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' # - julia -e 'Pkg.clone("GR"); Pkg.build("GR")' # # - julia -e 'Pkg.clone("https://github.com/tbreloff/ImageMagick.jl.git"); Pkg.checkout("ImageMagick","tb_write"); Pkg.build("ImageMagick")' diff --git a/appveyor.yml b/appveyor.yml index a626cae5..15796f23 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,8 +31,11 @@ install: build_script: # Need to convert from shallow to complete for Pkg.clone to work - IF EXIST .git\shallow (git fetch --unshallow) - - C:\projects\julia\bin\julia -e "versioninfo(); Pkg.clone(pwd(), \"Plots\"); Pkg.build(\"Plots\")" + - C:\projects\julia\bin\julia -e " + using InteractiveUtils, Pkg; + versioninfo(); + Pkg.clone(pwd(), \"Plots\"); + Pkg.build(\"Plots\")" test_script: - # - C:\projects\julia\bin\julia -e "Pkg.test(\"Plots\")" - - C:\projects\julia\bin\julia -e "include(Pkg.dir(\"Plots\", \"test\", \"travis_commands.jl\"))" + - C:\projects\julia\bin\julia -e "using Pkg; Pkg.test(\"Plots\")" diff --git a/src/Plots.jl b/src/Plots.jl index 2b96c5cb..e02cc169 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -116,7 +116,7 @@ ignorenan_minimum(x) = Base.minimum(x) ignorenan_maximum(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.maximum(x) ignorenan_maximum(x) = Base.maximum(x) ignorenan_mean(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.mean(x) -ignorenan_mean(x) = Base.mean(x) +ignorenan_mean(x) = Statistics.mean(x) ignorenan_extrema(x::AbstractArray{F}) where {F<:AbstractFloat} = NaNMath.extrema(x) ignorenan_extrema(x) = Base.extrema(x) diff --git a/test/REQUIRE b/test/REQUIRE index 6cd6a973..a11706d9 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -2,6 +2,7 @@ StatPlots Images ImageMagick @osx QuartzImageIO +FileIO GR 0.31.0 RDatasets VisualRegressionTests diff --git a/test/add_packages.jl b/test/add_packages.jl new file mode 100644 index 00000000..655ec4d6 --- /dev/null +++ b/test/add_packages.jl @@ -0,0 +1,24 @@ +using Pkg + +# need this to use Conda +# ENV["PYTHON"] = "" + +Pkg.add([ + PackageSpec(url="https://github.com/JuliaPlots/PlotReferenceImages.jl.git"), + # PackageSpec(url="https://github.com/JuliaStats/KernelDensity.jl.git"), + PackageSpec(name="PlotUtils", rev="master"), + PackageSpec(name="RecipesBase", rev="master"), + # PackageSpec(name="Blink", rev="master"), + # PackageSpec(name="Rsvg", rev="master"), + # PackageSpec(name="PlotlyJS", rev="master"), + # PackageSpec(name="VisualRegressionTests", rev="master"), + # PackageSpec("PyPlot"), + # PackageSpec("InspectDR"), +]) + +Pkg.build("ImageMagick") +# Pkg.build("GR") +# Pkg.build("Blink") +# import Blink +# Blink.AtomShell.install() +# Pkg.build("PyPlot") diff --git a/test/imgcomp.jl b/test/imgcomp.jl index abc08b13..92841b92 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -2,6 +2,10 @@ using VisualRegressionTests # using ExamplePlots +if isinteractive() + @eval Main import Gtk +end + # import DataFrames, RDatasets # don't let pyplot use a gui... it'll crash @@ -15,6 +19,8 @@ using VisualRegressionTests using Plots # using StatPlots +import PlotReferenceImages +using Random using Test default(size=(500,300)) @@ -38,7 +44,7 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = is # reference image directory setup # refdir = joinpath(Pkg.dir("ExamplePlots"), "test", "refimg", string(pkg)) - refdir = Pkg.dir("PlotReferenceImages", "Plots", string(pkg)) + refdir = joinpath(dirname(pathof(PlotReferenceImages)), "..", "Plots", string(pkg)) fn = "ref$idx.png" # firgure out version info diff --git a/test/runtests.jl b/test/runtests.jl index fd9f00bf..61d0e049 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,6 @@ module PlotsTests +include("add_packages.jl") include("imgcomp.jl") # don't actually show the plots diff --git a/test/travis_commands.jl b/test/travis_commands.jl deleted file mode 100644 index b4e6ff7e..00000000 --- a/test/travis_commands.jl +++ /dev/null @@ -1,34 +0,0 @@ -using Pkg - -Pkg.add("ImageMagick") -Pkg.build("ImageMagick") - -# Pkg.clone("GR") -# Pkg.build("GR") - -Pkg.checkout("https://github.com/JuliaPlots/PlotReferenceImages.jl.git") - -# Pkg.clone("https://github.com/JuliaStats/KernelDensity.jl.git") - -# Pkg.add("StatPlots") -Pkg.checkout("PlotUtils") -Pkg.checkout("RecipesBase") - -# Pkg.clone("Blink") -# Pkg.build("Blink") -# import Blink -# Blink.AtomShell.install() -# Pkg.add("Rsvg") -# Pkg.add("PlotlyJS") - -# Pkg.checkout("RecipesBase") -# Pkg.clone("VisualRegressionTests") - -# need this to use Conda -# ENV["PYTHON"] = "" -# Pkg.add("PyPlot") -# Pkg.build("PyPlot") - -# Pkg.add("InspectDR") - -Pkg.test("Plots"; coverage=false)