[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Allow testing of svn client exit codes

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Tue, 04 Mar 2008 13:56:18 +0000

Is anyone able to review Jeremy's patch for the test suite, or test it
(especially on Windows)?

Some brief comments on the log message:
   (1) There's no indication that any of this is platform-specific; is it?
(Does it work properly on Windows, as a possible problem was mentioned earlier?)
   (2) I'd add your second paragraph below ("This has all...") into the log
message.
   (3) Where you write "Capture exit_code ..." that kind of implies saving it,
but in fact it gets ignored; perhaps you could use words like "Accept and
ignore the exit code" instead.

These things are just niceties for when the patch gets accepted and committed.

- Julian

jeremy hinds wrote:
> Here is the revised patch for review. Corresponding changes to the
> test scripts aren't included yet (though a few are in the attachment,
> so that these changes can actually be executed).
>
> This has all of the lower-level process-running functions returning
> the exit code, all of the "run_and_verify_*()" functions guessing the
> expected exit code, and new "run_and_verify_*2()" functions allowing
> the expected exit code to be provided explicitly.
>
> [[[
> Allow testing of application exit codes.
>
> * subversion/tests/cmdline/svntest/main.py
> (run_command, run_svn, run_svnadmin, run_svnlook, run_svnsync,
> run_svnversion): Include exit_code in the returned tuple.
>
> (create_repos): Capture exit_code returned from run_command.
>
> * subversion/tests/cmdline/svntest/actions.py
> (run_and_verify_svnlook2, run_and_verify_svnadmin2,
> run_and_verify_svnversion2, run_and_verify_svn2,
> run_and_verify_svn_match_any2): New, execute the indicated binary
> and check actual outputs and exit code against the expected value
> parameters.
>
> (run_and_verify_svnlook, run_and_verify_svnadmin,
> run_and_verify_svnversion, run_and_verify_svn,
> run_and_verify_svn_match_any): Guess whether the expected exit should
> be 0 or 1 based on whether output is expected on stderr. Then invoke
> the coresponding run_and_verify_*2 function with that value. Return
> exit_code, stdout_lines, stderr_lines.
>
> (setup_pristine_repository, run_and_verify_load, run_and_verify_dump,
> run_and_verify_checkout, run_and_verify_update, run_and_verify_commit,
> run_and_verify_status, run_and_verify_unquiet_status,
> run_and_verify_diff_summarize, check_prop, inject_conflict_into_wc):
> Capture exit_code value returned from main.run_svn, main.run_command,
> main.run_svnadmin, main.run_command_stdin
>
> * subversion/tests/cmdline/svntest/tree.py
> (get_props): Capture exit code returned by main.run_svn.
>
> * subversion/tests/cmdline/svntest/verify.py
> (SVNUnexpectedExitCode): New exception raised when the exit code was not
> what was expected.
>
> (verify_exit_code): New, compares expected and actual exit code and raises
> an exception if they are different.
> ]]]
[...]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-03-04 14:56:40 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.