Closed moonwatcher closed 1 year ago
Just for completion sake, this implementation uses the tmpfile()
method, this method opens up a temporary file, usually in /tmp
, with some random name in r/w
mode and deletes it when you close the file handler. its a little different than the original test that opened a file, read it with MMRead
closed it than wrote it with some comments, closed it. opened it again and read it into a GrB_Matrix
and compared. so its testing both MMRead
and MMWrite
, adding comments and making sure they don't change the resulting GrB_Matrix
. This implementation does all this but without closing the file. The temp file is opened with r/w
and then rewinded every time. This is nothing new, some other parts of test_MMRead
use this same logic (I just replicated this pattern).
@jamesETsmith comment removed. You can merge it as you leisure.
test_MMRead
contains a subtest that (strangely) testMMWrite
. That test seems to modify thecomments.txt
andcomments_*.mtx
files. At the end oftest_MMRead
those files go back to how they were checked into the repository but that means that a failure intest_MMRead
can drag on ghost failures in other tests (specifically observed intest_minmax
). Iftest_MMRead
passes all is well, but if it doesn't it can be pretty weird...This PR changes the test to write to temp files, opened
r/w
withtmpfile()
and rewinded instead of opened separately for write then read.The total effect is not changing the data directory and remove this spurious effect.
I also added
build*
to.gitignore
since we build inbuild_lc
and it makes the git diff... irritating...