On Mon, Jan 26, 2009 at 9:04 PM, Dan Drake <dr...@kaist.edu> wrote:
> Last week I fixed a bug (#5052) in sage-preparse and I noticed that
> there are no doctests in the file. Here we have another example of
> untested code being broken -- is there any way to do doctesting of files
> in local/bin?

Yes, it's possible and definitely should be done.

> Certainly many of the files there can't be doctested (binaries, as an
> obvious example) but is there a way to run tests on the other files? The
> function in sage-preparse that I fixed could easily have a bunch of
> tests, and I'm guessing other things in that directory could too.
>
> Thoughts?

+10 to testing!

Obviously you want a specific way to do testing.  Hmmm. Obviously,
there are many options.  We should start really small.  Here's a
minimal proposal just to get the ball rolling.

1. Create a file in devel/sage/sage/test/ called something like
test_sage_local.py

2. In that file put some doctests that test something about the file
sage-preparse, e.g.,
something like

sage: d = tmp_dir()
sage: os.chdir(d)
sage: # create a file or something
sage: os.system('sage -preparse file.sage')
sage: # check some stuff about the output file.py

3. Submit this as a patch to sage.  Then whenever anybody does

  sage -t test_sage_local.py

they will test out the functionality you want to test.

In short, the current testing framework could already be used to test
local/bin/.

We could alternatively come up with something new, but I'm not sure we
want to deal with the increase in complexity in having a new testing
system, given that it isn't strictly necessary.

The main problem I see with the above is that it is hard to see what
the test coverage of the files in local/bin/ is.

 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to