tmake gnuplot tests optional - Granular.jl - Julia package for granular dynamics simulation (HTM) git clone git://src.adamsgaard.dk/Granular.jl (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit f8e0e4db6963a0e5775539a65d8f85add7af9565 (DIR) parent bec7677dc0ef0a4bd5f91faa495d3751de43e62e (HTM) Author: Anders Damsgaard <andersd@riseup.net> Date: Fri, 17 Nov 2017 20:16:01 -0500 make gnuplot tests optional Diffstat: M test/grain.jl | 33 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) --- (DIR) diff --git a/test/grain.jl b/test/grain.jl t@@ -30,17 +30,28 @@ Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) Granular.compareGrains(sim.grains[1], sim.grains[2]) -info("Testing GSD plotting ") -Granular.plotGrainSizeDistribution(sim) -@test isfile("test-grain-size-distribution.png") -rm("test-grain-size-distribution.png") -Granular.plotGrainSizeDistribution(sim, skip_fixed=false) -@test isfile("test-grain-size-distribution.png") -rm("test-grain-size-distribution.png") -Granular.plotGrainSizeDistribution(sim, size_type="areal") -@test isfile("test-grain-size-distribution.png") -rm("test-grain-size-distribution.png") -@test_throws ErrorException Granular.plotGrainSizeDistribution(sim, size_type="asdf") +gnuplot = true +try + run(`gnuplot --version`) +catch return_signal + if isa(return_signal, Base.UVError) + warn("Skipping plotting routines: Could not launch gnuplot process") + gnuplot = false + end +end +if gnuplot + info("Testing GSD plotting ") + Granular.plotGrainSizeDistribution(sim) + @test isfile("test-grain-size-distribution.png") + rm("test-grain-size-distribution.png") + Granular.plotGrainSizeDistribution(sim, skip_fixed=false) + @test isfile("test-grain-size-distribution.png") + rm("test-grain-size-distribution.png") + Granular.plotGrainSizeDistribution(sim, size_type="areal") + @test isfile("test-grain-size-distribution.png") + rm("test-grain-size-distribution.png") + @test_throws ErrorException Granular.plotGrainSizeDistribution(sim, size_type="asdf") +end info("Testing external body force routines") sim = Granular.createSimulation(id="test")