You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Glasser <gl...@mit.edu> on 2006/10/03 14:52:39 UTC

Testing $SVNEDITOR in the command-line tests

As far as I can tell, none of the tests test things like "svn
propedit" which require an editor.  Since I'm planning to add URL
editing to "svn propedit", I'd like to fix that first.  Here's my
idea:

Make a script, subversion/tests/cmdline/svneditor.py, which reads in
the file given to it, looks at the environment variable
$SVNTEST_EDITOR, and calls svntest.editors.($SVNTEST_EDITOR) with the
contents of the file, writes back to the file whatever that function
returns, and exits.

Then add a function, "svntest.main.use_editor" which takes a function
name, sets $SVNEDITOR to point to the new script, and $SVNTEST_EDITOR
to be that function.  (These environment variables will get cleared
before/after each test.)

So, the idea is, we'd have a function svntest.editors.foo_to_bar which
changes "foo" to "bar" in its argument, and before a call to
run_and_verify_svn for propedit, we'd put a line like
"svntest.main.use_editor('foo_to_bar')".  You could easily use the
same editor for a bunch of tests.

Sound sane?

--dave

-- 
David Glasser | glasser@mit.edu | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Testing $SVNEDITOR in the command-line tests

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 10/3/06, David Glasser <gl...@mit.edu> wrote:
> As far as I can tell, none of the tests test things like "svn
> propedit" which require an editor.  Since I'm planning to add URL
> editing to "svn propedit", I'd like to fix that first.  Here's my
> idea:
>
> Make a script, subversion/tests/cmdline/svneditor.py, which reads in
> the file given to it, looks at the environment variable
> $SVNTEST_EDITOR, and calls svntest.editors.($SVNTEST_EDITOR) with the
> contents of the file, writes back to the file whatever that function
> returns, and exits.
>
> Then add a function, "svntest.main.use_editor" which takes a function
> name, sets $SVNEDITOR to point to the new script, and $SVNTEST_EDITOR
> to be that function.  (These environment variables will get cleared
> before/after each test.)
>
> So, the idea is, we'd have a function svntest.editors.foo_to_bar which
> changes "foo" to "bar" in its argument, and before a call to
> run_and_verify_svn for propedit, we'd put a line like
> "svntest.main.use_editor('foo_to_bar')".  You could easily use the
> same editor for a bunch of tests.
>
> Sound sane?

+1 from me, go for it.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org