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

Re: [PATCH] Add diagnostic output to svnversion_tests.py

From: Michael Wood <mwood_at_its.uct.ac.za>
Date: 2003-08-05 12:16:00 CEST

Hi

On Tue, Aug 05, 2003 at 07:46:10AM +0000, Erik Hülsmann wrote:
> Hi,
>
> I changed the svnversion_tests.py file to generate diagnostic output
> like the run_and_verify_* series of commands does for svn.
[snip]
> +def run_and_verify_svnversion(wc_dir, repo_url, expected_output):
> + "run the svnversion command and check it's output"
> + output, errput = svntest.main.run_svnversion(wc_dir, repo_url)
> + if (expected_output and (errput or output != expected_output)):
> + print "COMMAND:\nsvnversion ", wc_dir, " ", repo_url
> + print "EXPECTED: (stdout)\n", expected_output
> + print "ACTUAL:\n", "stdout:\n", output
> + print "stderr:\n", errput
> + return 1

Why not "raise svntest.Failure" here?

> + elif ((not expected_output) and (not errput or output)):
> + print "COMMAND:\nsvnversion ", wc_dir, " ", repo_url
> + print "EXPECTED: (stdout)\n(none)"
> + print "ACTUAL:\nstdout:\n", output
> + print "stderr:\n", errput
> + return 1

And here?

> + else:
> + return 0
> +
> +
> +#----------------------------------------------------------------------
> +
> def svnversion_test(sbox):
> "test 'svnversion' on a working copy and other directories"
> sbox.build()
> @@ -37,21 +58,18 @@
> repo_url = sbox.repo_url
>
> # Unmodified
> - output, errput = svntest.main.run_svnversion(wc_dir, repo_url)
> - if errput or output != [ "1\n" ]:
> + if run_and_verify_svnversion(wc_dir, repo_url, [ "1\n" ]):
> raise svntest.Failure

And then just change this to:
- output, errput = svntest.main.run_svnversion(wc_dir, repo_url)
- if errput or output != [ "1\n" ]:
- raise svntest.Failure
+ run_and_verify_svnversion(wc_dir, repo_url, [ "1\n" ])

Same for the others.

Please ignore my comments if you don't feel they're valid :)

-- 
Michael Wood <mwood@its.uct.ac.za>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 5 12:17:00 2003

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.