Skip to content

Commit

Permalink
Merge pull request #21703 from JuliaLang/yyc/tests/tmp
Browse files Browse the repository at this point in the history
Do not hard code temp file path in the test.
  • Loading branch information
yuyichao authored May 5, 2017
2 parents d672716 + f3e4256 commit 22901aa
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions test/sparse/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,30 +191,21 @@ ACSC = sprandn(10, 10, 0.3) + I
@test ishermitian(Sparse(Hermitian(complex(ACSC), :U)))

# test Sparse constructor for c_SparseVoid (and read_sparse)
let testfile = joinpath(tempdir(), "tmp.mtx")
try
writedlm(testfile, ["%%MatrixMarket matrix coordinate real symmetric","3 3 4","1 1 1","2 2 1","3 2 0.5","3 3 1"])
@test sparse(CHOLMOD.Sparse(testfile)) == [1 0 0;0 1 0.5;0 0.5 1]
finally
rm(testfile)
end
end
let testfile = joinpath(tempdir(), "tmp.mtx")
try
writedlm(testfile, ["%%MatrixMarket matrix coordinate complex Hermitian",
"3 3 4","1 1 1.0 0.0","2 2 1.0 0.0","3 2 0.5 0.5","3 3 1.0 0.0"])
@test sparse(CHOLMOD.Sparse(testfile)) == [1 0 0;0 1 0.5-0.5im;0 0.5+0.5im 1]
finally
rm(testfile)
end
end
let testfile = joinpath(tempdir(), "tmp.mtx")
try
writedlm(testfile, ["%%MatrixMarket matrix coordinate real symmetric","%3 3 4","1 1 1","2 2 1","3 2 0.5","3 3 1"])
@test_throws ArgumentError sparse(CHOLMOD.Sparse(testfile))
finally
rm(testfile)
end
mktempdir() do temp_dir
testfile = joinpath(temp_dir, "tmp.mtx")

writedlm(testfile, ["%%MatrixMarket matrix coordinate real symmetric","3 3 4","1 1 1","2 2 1","3 2 0.5","3 3 1"])
@test sparse(CHOLMOD.Sparse(testfile)) == [1 0 0;0 1 0.5;0 0.5 1]
rm(testfile)

writedlm(testfile, ["%%MatrixMarket matrix coordinate complex Hermitian",
"3 3 4","1 1 1.0 0.0","2 2 1.0 0.0","3 2 0.5 0.5","3 3 1.0 0.0"])
@test sparse(CHOLMOD.Sparse(testfile)) == [1 0 0;0 1 0.5-0.5im;0 0.5+0.5im 1]
rm(testfile)

writedlm(testfile, ["%%MatrixMarket matrix coordinate real symmetric","%3 3 4","1 1 1","2 2 1","3 2 0.5","3 3 1"])
@test_throws ArgumentError sparse(CHOLMOD.Sparse(testfile))
rm(testfile)
end

# test that Sparse(Ptr) constructor throws the right places
Expand Down

2 comments on commit 22901aa

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.