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

Re: [PATCH] run_test.py appearance changes

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Mon, 1 Apr 2013 03:31:36 +0300

Gabriela Gibson wrote on Sun, Mar 31, 2013 at 23:27:48 +0100:
> [[[
> Disable ANSI color for dumb terminals, format terminal test output.
>
> * build/run_tests.py
> (TestHarness): Add test condition, format terminal output.
>
> ]]]
>
> I disabled color conditionally for dumb terminals because the control
> characters are displayed in the raw in those.
>
>

> Index: build/run_tests.py
> ===================================================================
> --- build/run_tests.py (revision 1463012)
> +++ build/run_tests.py (working copy)
> @@ -178,7 +178,8 @@ class TestHarness:
> self.log = None
> self.ssl_cert = ssl_cert
> self.http_proxy = http_proxy
> - if not sys.stdout.isatty() or sys.platform == 'win32':
> + if not sys.stdout.isatty() or sys.platform == 'win32' or \
> + os.getenv("TERM") == "dumb":
> TextColors.disable()
>

+1 to this hunk.

(Normally it would be better to go for a whitelist here, ie, disable
colours unless the terminal supports them; but the above change is an
improvement in your setup and won't break anyone else's, hence the +1.)

> def run(self, list):
> @@ -565,7 +566,8 @@ class TestHarness:
> progdir, progbase = os.path.split(prog)
> if self.log:
> # Using write here because we don't want even a trailing space
> - test_info = '[%s/%d] %s' % (str(test_nr + 1).zfill(len(str(total_tests))),
> + test_info = '[%s/%d] %-35s' % \

No +1 on this part, as I don't see why it's necessary.

With this, I get:

[01/98] auth-test ..............................success
[02/98] cache-test ..............................success
[03/98] checksum-test ..............................success
[04/98] client-test ..............................success

Without it, I get:

[01/98] auth-test........................................................success
[02/98] cache-test.......................................................success
[03/98] checksum-test....................................................success
[04/98] client-test......................................................success

At a wild guess, perhaps the issue is that you need to set
$SVN_MAKE_CHECK_COLUMNS (line 91)?

> + (str(test_nr + 1).zfill(len(str(total_tests))),
> total_tests, progbase)
> if self.list_tests:
> sys.stdout.write('Listing tests in %s' % (test_info, ))

As to your other patch about diff3, I will leave reviewing the new
iteration of it to someone else who is more familiar with that area of
the code. I did note, though, that you missed adding the SVN_DEPRECATED
marker to the being-deprecated function.

Daniel
Received on 2013-04-01 02:32:25 CEST

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