> 2. -tnew > > Not in the developer walkthrough since I didn't know about it when I > wrote that. Limited testing indicates it looks for changed files in > the mercurial repository that have not been commit'ed and tests > those. It strikes me that looking for dependencies is a big job - > there is no automatic way to see if any particular test, does, or does > not, use a particular file/module without examining every function/ > method call, and vice-versa (ie which functions appear in which > tests). In other words, there is not something easy like import > statements or included header files to follow. You can put any > function in any doctest in any file. But I could be wrong about this. > > I think this is a bit dangerous to include in introductory > documentation, as it gives the impression this might be sufficient > testing? I tend to test the file(s) I am editing, then maybe a whole > portion of the sage library tree when I'm close to done, and > everything before submitting something critical (like linear algebra > code). I think a human/mathematician can make a fairly informed guess > about how much to doctest, and always err on the side of too much. > And somebody new would be wise to doctest everything initially. That > said, I'll look into addressing the ticket referenced above.
After having thought a bit about it, I agree that it should not be directly encouraged in the very first introduction, as it is definitely undecidable to determine for sure the minimal set of files to doctest. It would probably not be too hard to write a "-tnew_and_deps" flag that would find almost all modules depending on changed modules: simply grep for all files verbosely invoking functions defined in changed files, and do this recursively. Most code is relatively wellbehaved and shouldn't -- I would think -- use too much reflection or dynamic code evaluation (I could be wrong here, of course). However, as I mentioned, this would be an under-approximation of the modules which should be tested, and is therefore inherently unsafe compared to doctesting everything. I haven't tried it, but it might also be a bit slow (though of course faster than doctesting). Johan -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
