clawpack / clawutil

General utility programs
BSD 3-Clause "New" or "Revised" License
10 stars 31 forks source link

clean up *.o files in test path before each test #120

Closed xinshengqin closed 7 years ago

xinshengqin commented 7 years ago

Just updated it.

I have tested it with no *.o files in test path so I think it works even glob returns nothing

mandli commented 7 years ago

This looks fine to me. @rjleveque do you have any idea how this might break things if implemented?

rjleveque commented 7 years ago

This only removes the *.o and *.mod files in the test directory, not in the library directories, as far as I can tell. I inserted print statements in test.py to print each file as it removes it.

So I'm not sure this addresses clawpack/amrclaw#196.

On the other hand, if I change a library file and then redo nosetests, it does recompile the library routine, so I'm not sure why there's even an issue here??

Otherwise, this PR seems to work fine in the repositories I tested it in.

xinshengqin commented 7 years ago

@rjleveque I think it's a matter of whether we want to remove the .o and .mod files in the library directories.

I think nosetests is calling make in it. So if you change a library file, when you run nosetests, it calls make and make knows that the source code has been changed and recompile that.

mandli commented 7 years ago

The library is always rebuilt at the beginning of a set of tests. @xinshengqin's issue involved local source (qinit for instance) that would not be rebuilt so I think this does what we want.