I'd lean more towards calling this "development", rather than
"design".
On Tue, 27 Nov 2007, lgo@tigris.org wrote:
> Author: lgo
> Date: Tue Nov 27 13:55:40 2007
> New Revision: 28089
>
> Log:
> Add --design option to the python test suite. At this time the option only
> makes the tests continue when one of the run_and_verify fails. This is a
> (small) start to making it easier to write python regression tests.
>
> * subversion/tests/cmdline/svntest/main.py
> (setup_design_mode, wrap_ex): Wrap/decorate all run_and_verify* functions. In
> the wrapper, print out but further ignore all exceptions.
> (usage, run_tests): Add '--design' option.
>
>
> Modified:
> trunk/subversion/tests/cmdline/svntest/main.py
>
> Modified: trunk/subversion/tests/cmdline/svntest/main.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/svntest/main.py?pathrev=28089&r1=28088&r2=28089
> ==============================================================================
> --- trunk/subversion/tests/cmdline/svntest/main.py (original)
> +++ trunk/subversion/tests/cmdline/svntest/main.py Tue Nov 27 13:55:40 2007
> @@ -232,6 +232,41 @@
>
> ######################################################################
> # Utilities shared by the tests
> +def wrap_ex(func):
> + "Wrap a function, catch, print and ignore exceptions"
> + def w(*args, **kwds):
> + try:
> + return func(*args, **kwds)
> + except Failure, ex:
> + if ex.__class__ != Failure or ex.args:
> + ex_args = str(ex)
> + if ex_args:
> + print 'EXCEPTION: %s: %s' % (ex.__class__.__name__, ex_args)
> + else:
> + print 'EXCEPTION:', ex.__class__.__name__
> + return w
> +
> +def setup_design_mode():
> + "Wraps functions in module actions"
> + l = [ 'run_and_verify_svn',
> + 'run_and_verify_svnversion',
> + 'run_and_verify_load',
> + 'run_and_verify_dump',
> + 'run_and_verify_checkout',
> + 'run_and_verify_export',
> + 'run_and_verify_update',
> + 'run_and_verify_merge',
> + 'run_and_verify_merge2',
> + 'run_and_verify_switch',
> + 'run_and_verify_commit',
> + 'run_and_verify_unquiet_status',
> + 'run_and_verify_status',
> + 'run_and_verify_diff_summarize',
> + 'run_and_verify_diff_summarize_xml',
> + 'run_and_validate_lock']
> +
> + for func in l:
> + setattr(actions, func, wrap_ex(getattr(actions, func)))
>
> def get_admin_name():
> "Return name of SVN administrative subdirectory."
> @@ -1147,6 +1182,10 @@
> print " --bin Use the svn binaries installed in this path"
> print " --use-jsvn Use the jsvn (SVNKit based) binaries. Can be\n" \
> " combined with --bin to point to a specific path"
> + print " --design Test design mode: provides more detailed test\n" \
> + " output and ignores all exceptions in the \n" \
> + " run_and_verify* functions. This option is only \n" \
> + " useful during test development!"
> print " --help This information"
>
>
> @@ -1191,7 +1230,7 @@
> ['url=', 'fs-type=', 'verbose', 'quiet', 'cleanup',
> 'list', 'enable-sasl', 'help', 'parallel',
> 'bin=', 'http-library=', 'server-minor-version=',
> - 'use-jsvn'])
> + 'use-jsvn', 'design'])
> except getopt.GetoptError, e:
> print "ERROR: %s\n" % e
> usage()
> @@ -1258,6 +1297,9 @@
> elif opt == '--use-jsvn':
> use_jsvn = True
>
> + elif opt == '--design':
> + setup_design_mode()
> +
> if test_area_url[-1:] == '/': # Normalize url to have no trailing slash
> test_area_url = test_area_url[:-1]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
- application/pgp-signature attachment: stored
Received on Wed Nov 28 18:53:34 2007