diff --git a/Project.toml b/Project.toml index 251c71f7..f03c1ed2 100644 --- a/Project.toml +++ b/Project.toml @@ -59,6 +59,7 @@ LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925" +HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" @@ -68,4 +69,4 @@ UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92" [targets] -test = ["FileIO", "GeometryTypes", "Gtk", "ImageMagick", "Images", "LaTeXStrings", "LibGit2", "OffsetArrays", "PGFPlotsX", "Random", "RDatasets", "StaticArrays", "StatsPlots", "Test", "UnicodePlots", "VisualRegressionTests"] +test = ["FileIO", "GeometryTypes", "Gtk", "ImageMagick", "Images", "LaTeXStrings", "LibGit2", "OffsetArrays", "PGFPlotsX", "HDF5", "Random", "RDatasets", "StaticArrays", "StatsPlots", "Test", "UnicodePlots", "VisualRegressionTests"] diff --git a/test/runtests.jl b/test/runtests.jl index 5ddc6818..9b36f097 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,6 +9,7 @@ using LibGit2 using GeometryTypes using Dates +include("test_hdf5plots.jl") include("test_pgfplotsx.jl") reference_dir(args...) = joinpath(homedir(), ".julia", "dev", "PlotReferenceImages", args...) diff --git a/test/test_hdf5plots.jl b/test/test_hdf5plots.jl new file mode 100644 index 00000000..2c106025 --- /dev/null +++ b/test/test_hdf5plots.jl @@ -0,0 +1,21 @@ +using Plots, HDF5 + + +@testset "HDF5_Plots" begin + fname = "tmpplotsave.hdf5" + hdf5() + + x = 1:10 + psrc=plot(x, x.*x); #Create some plot + Plots.hdf5plot_write(psrc, fname) + + #Read back file: + gr() #Choose some fast backend likely to work in test environment. + pread = Plots.hdf5plot_read(fname) + + #Make sure data made it through: + @test psrc.subplots[1].series_list[1][:x] == pread.subplots[1].series_list[1][:x] + @test psrc.subplots[1].series_list[1][:y] == pread.subplots[1].series_list[1][:y] + + #display(pread) #Don't display. Regression env might not support +end #testset