commit d07cf4a11cda63a0d7a0b342787721cb27c02e6e
parent 34985c227ef815ae8c6d65e0ceceaec7e69009d4
Author: Anders Damsgaard <andersd@riseup.net>
Date: Thu, 9 Nov 2017 10:58:39 -0600
use Compat.Sys for version-independent system checks
Diffstat:
7 files changed, 12 insertions(+), 30 deletions(-)
diff --git a/deps/build.jl b/deps/build.jl
@@ -1,6 +1,6 @@
#!/usr/bin/env julia
using BinDeps
-using Compat
+import Compat.Sys
@BinDeps.setup
@@ -10,7 +10,7 @@ provides(AptGet, "imagemagick", imagemagick, os = :Linux)
provides(Yum, "ImageMagick", imagemagick, os = :Linux)
provides(Pacman, "imagemagick", imagemagick, os = :Linux)
-if is_apple()
+if Compat.Sys.isapple()
if Pkg.installed("Homebrew") === nothing
error("Homebrew julia package not installed, " *
"please run Pkg.add(\"Homebrew\")")
@@ -18,7 +18,7 @@ if is_apple()
using Homebrew
provides(Homebrew.HB, "imagemagick", imagemagick, os = :Darwin)
-elseif is_windows()
+elseif Compat.Sys.iswindows()
using WinRPM
provides(WinRPM.RPM, "imagemagick", imagemagick, os = :Windows)
end
diff --git a/src/atmosphere.jl b/src/atmosphere.jl
@@ -1,8 +1,4 @@
-if VERSION < v"0.7.0-DEV.2004"
- using Base.Test
-else
- using Test
-end
+using Compat.Test
export createEmptyAtmosphere
"Returns empty ocean type for initialization purposes."
diff --git a/src/grain.jl b/src/grain.jl
@@ -1,10 +1,5 @@
## Manage grains in the model
-using Compat
-if VERSION < v"0.7.0-DEV.2004"
- using Base.Test
-else
- using Test
-end
+using Compat.Test
hasPyPlot = false
if typeof(Pkg.installed("PyPlot")) == VersionNumber
diff --git a/src/grid.jl b/src/grid.jl
@@ -534,7 +534,6 @@ function findEmptyPositionInGridCell(simulation::Simulation,
nx, ny = size(grid.xh)
- i_iter=0
for i_iter=1:n_iter
overlap_found = false
@@ -585,7 +584,7 @@ function findEmptyPositionInGridCell(simulation::Simulation,
end
end
if verbose && overlap_found == false
- info("Found position $pos in cell $i,$j after $i_iter iterations")
+ info("Found position $pos in cell $i,$j")
elseif verbose && overlap_found
info("Free position not found in cell $i,$j")
end
diff --git a/src/ocean.jl b/src/ocean.jl
@@ -1,8 +1,4 @@
-if VERSION < v"0.7.0-DEV.2004"
- using Base.Test
-else
- using Test
-end
+using Compat.Test
export createEmptyOcean
"Returns empty ocean type for initialization purposes."
diff --git a/test/runtests.jl b/test/runtests.jl
@@ -1,9 +1,4 @@
-using Compat
-if VERSION < v"0.7.0-DEV.2004"
- using Base.Test
-else
- using Test
-end
+using Compat.Test
import Granular
include("grain.jl")
diff --git a/test/vtk.jl b/test/vtk.jl
@@ -1,4 +1,5 @@
#!/usr/bin/env julia
+import Compat
# Check the contact search and geometry of a two-particle interaction
@@ -13,11 +14,11 @@ Granular.findContacts!(sim, method="all to all")
Granular.writeVTK(sim, verbose=false)
cmd_post = ""
-if is_linux()
+if Compat.Sys.islinux()
cmd = "sha256sum"
-elseif is_apple()
+elseif Compat.Sys.isapple()
cmd = ["shasum", "-a", "256"]
-elseif is_windows()
+elseif Compat.Sys.iswindows()
info("checksum verification not yet implemented on Windows")
exit()
cmd = ["powershell", "-Command", "\"Get-FileHash", "-Algorithm", "SHA256"]