Skip to content

Commit a433ef1

Browse files
author
Jeremy Edward Kozdon
committed
Update the tests
1 parent 0dedcda commit a433ef1

27 files changed

+106
-85
lines changed

test/runtests.jl

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using MPI
2-
using Base.Test
2+
using Compat.Test
33

44
using Compat
55
import Compat.String
@@ -21,13 +21,20 @@ juliafiles = ["test_cman_julia.jl"]
2121
singlefiles = ["test_spawn.jl"]
2222

2323
excludedfiles = []
24-
if is_windows()
25-
excludedfiles = ["test_info.jl", "test_onesided.jl", "test_finalize_atexit.jl"]
24+
if Compat.Sys.iswindows()
25+
push!(excludedfiles, "test_info.jl")
26+
push!(excludedfiles, "test_onesided.jl")
27+
push!(excludedfiles, "test_finalize_atexit.jl")
2628
if Sys.WORD_SIZE == 32
2729
push!(excludedfiles, "test_spawn.jl")
2830
end
2931
end
3032

33+
if VERSION > v"0.7.0-DEV.2005"
34+
push!(excludedfiles, "test_cman_julia.jl")
35+
push!(excludedfiles, "test_cman_mpi.jl")
36+
push!(excludedfiles, "test_cman_tcp.jl")
37+
end
3138
function runtests()
3239
nprocs = clamp(Sys.CPU_CORES, 2, 4)
3340
exename = joinpath(BINDIR, Base.julia_exename())
@@ -36,14 +43,14 @@ function runtests()
3643
testfiles = sort(filter(istest, readdir(testdir)))
3744

3845
extra_args = []
39-
@static if !is_windows()
40-
if contains(readlines(open(`mpiexec --version`)[1])[1], "OpenRTE")
46+
@static if !Compat.Sys.iswindows()
47+
if Compat.occursin( "OpenRTE", Compat.open(f->read(f, String),`mpiexec --version`))
4148
push!(extra_args,"--oversubscribe")
4249
end
4350
end
4451

4552
nfail = 0
46-
print_with_color(:white, "Running MPI.jl tests\n")
53+
Compat.printstyled("Running MPI.jl tests\n"; color=:white)
4754
for f in testfiles
4855
if f excludedfiles
4956
println("Skipping disabled test $f")
@@ -58,11 +65,11 @@ function runtests()
5865
else
5966
run(`mpiexec $extra_args -n $nprocs $exename --code-coverage=$coverage_opt $(joinpath(testdir, f))`)
6067
end
61-
Base.with_output_color(:green,STDOUT) do io
68+
Base.with_output_color(:green,Compat.stdout) do io
6269
println(io,"\tSUCCESS: $f")
6370
end
6471
catch ex
65-
Base.with_output_color(:red,STDERR) do io
72+
Base.with_output_color(:red,Compat.stderr) do io
6673
println(io,"\tError: $(joinpath(testdir, f))")
6774
showerror(io,ex,backtrace())
6875
end

test/spawned_worker.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Base.Test
1+
using Compat.Test
22
using MPI
33

44
MPI.Init()

test/test_allgather.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Base.Test
1+
using Compat.Test
22
using MPI
33

44
MPI.Init()
@@ -10,7 +10,7 @@ end
1010

1111
comm = MPI.COMM_WORLD
1212

13-
for typ in (isdefined(:UnionAll) ? Base.uniontypes(MPI.MPIDatatype) : MPI.MPIDatatype.types)
13+
for typ in Base.uniontypes(MPI.MPIDatatype)
1414
A = typ[MPI.Comm_rank(comm) + 1]
1515
C = allgather(A)
1616
@test typeof(C) === Vector{typ}

test/test_allgatherv.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Base.Test
1+
using Compat.Test
22
using MPI
33

44
MPI.Init()
@@ -15,7 +15,7 @@ rank = MPI.Comm_rank(comm)
1515
# Defining this to make ones work for Char
1616
Base.one(::Type{Char}) = '\01'
1717

18-
for typ in (isdefined(:UnionAll) ? Base.uniontypes(MPI.MPIDatatype) : MPI.MPIDatatype.types)
18+
for typ in Base.uniontypes(MPI.MPIDatatype)
1919

2020
A = ones(typ, mod(rank,2) + 1)
2121
counts = Cint[mod(i,2) + 1 for i in 0:(size-1)]

test/test_allreduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Base.Test
1+
using Compat.Test
22
using MPI
33

44
MPI.Init()

test/test_alltoall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Base.Test
1+
using Compat.Test
22

33
using MPI
44

test/test_alltoallv.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Base.Test
1+
using Compat.Test
22
using MPI
33

44
MPI.Init()
@@ -12,7 +12,7 @@ comm = MPI.COMM_WORLD
1212
size = MPI.Comm_size(comm)
1313
rank = MPI.Comm_rank(comm)
1414

15-
for typ in (isdefined(:UnionAll) ? Base.uniontypes(MPI.MPIDatatype) : MPI.MPIDatatype.types)
15+
for typ in Base.uniontypes(MPI.MPIDatatype)
1616
A = typ[]
1717
B = typ[]
1818
for i in 1:size

test/test_basic.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Base.Test
1+
using Compat
2+
using Compat.Test
23
using MPI
34

45
@test !MPI.Initialized()
@@ -7,7 +8,7 @@ MPI.Init()
78

89
@test MPI.Comm(MPI.CComm(MPI.COMM_WORLD)).val == MPI.COMM_WORLD.val
910

10-
if !is_windows()
11+
if !Compat.Sys.iswindows()
1112
MPI.finalize_atexit()
1213
@test MPI.FINALIZE_ATEXIT[]
1314
end

test/test_bcast.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Base.Test
1+
using Compat.Test
2+
using Compat.Random
23
using MPI
34

45
MPI.Init()
@@ -21,7 +22,7 @@ root = 0
2122
srand(17)
2223

2324
matsize = (17,17)
24-
for typ in (isdefined(:UnionAll) ? Base.uniontypes(MPI.MPIDatatype) : MPI.MPIDatatype.types)
25+
for typ in Base.uniontypes(MPI.MPIDatatype)
2526
A = rand(typ, matsize...)
2627
@test bcast_array(A, root) == A
2728
end

test/test_cman_julia.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
using Base.Test
1+
using Compat
2+
using Compat.Test
23
using MPI
4+
using Compat.Distributed
35

46
# Start workers via `mpiexec` that communicate among themselves via MPI;
57
# communicate with the workers via TCP
6-
if !is_windows() && contains(readlines(open(`mpiexec --version`)[1])[1], "OpenRTE")
8+
if !Compat.Sys.iswindows() && Compat.occursin( "OpenRTE", Compat.open(f->read(f, String),`mpiexec --version`))
79
mgr = MPI.MPIManager(np=4, mpirun_cmd=`mpiexec --oversubscribe -n 4`)
810
else
911
mgr = MPI.MPIManager(np=4)

0 commit comments

Comments
 (0)