Patchwork [6,of,9] tests: small refactoring of run-tests' handling of tests list

login
register
mail settings
Submitter Mads Kiilerich
Date March 18, 2014, 11:33 p.m.
Message ID <4546fe5f1b924ca58ac1.1395185634@localhost.localdomain>
Download mbox | patch
Permalink /patch/3976/
State Accepted
Commit 60c175c1e708460f05294b6628603e5978a81d02
Headers show

Comments

Mads Kiilerich - March 18, 2014, 11:33 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1395184794 -3600
#      Wed Mar 19 00:19:54 2014 +0100
# Node ID 4546fe5f1b924ca58ac18a14253ebdc31c9af9bd
# Parent  41894a7fe54a8b98d45b782ef49245486f24c0dc
tests: small refactoring of run-tests' handling of tests list
Matt Mackall - March 19, 2014, 6:26 p.m.
On Wed, 2014-03-19 at 00:33 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1395184794 -3600
> #      Wed Mar 19 00:19:54 2014 +0100
> # Node ID 4546fe5f1b924ca58ac18a14253ebdc31c9af9bd
> # Parent  41894a7fe54a8b98d45b782ef49245486f24c0dc
> tests: small refactoring of run-tests' handling of tests list

Queued for default, thanks.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1180,12 +1180,12 @@  def main():
 
     checktools()
 
-    if len(args) == 0:
-        args = [t for t in os.listdir(".")
-                if t.startswith("test-")
-                and (t.endswith(".py") or t.endswith(".t"))]
+    if not args:
+        args = os.listdir(".")
 
-    tests = args
+    tests = [t for t in args
+             if t.startswith("test-")
+             and (t.endswith(".py") or t.endswith(".t"))]
 
     if options.random:
         random.shuffle(tests)