From 875e32e2fb89ce5236b5db96cdbbe2d8b2d4542f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Dec 2016 16:05:51 +0100 Subject: regrtest --fromfile now accepts a list of filenames --- Lib/test/libregrtest/main.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Lib/test/libregrtest/main.py') diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index f0effc973c..e113ed63dd 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -179,19 +179,17 @@ class Regrtest: self.tests = [] # regex to match 'test_builtin' in line: # '0:00:00 [ 4/400] test_builtin -- test_dict took 1 sec' - regex = (r'^(?:[0-9]+:[0-9]+:[0-9]+ *)?' + regex = (r'(?:[0-9]+:[0-9]+:[0-9]+ *)?' r'(?:\[[0-9/ ]+\] *)?' - r'(test_[a-zA-Z0-9_]+)') + r'(test_[a-zA-Z0-9_]+)\b(?:\.py)?') regex = re.compile(regex) with open(os.path.join(support.SAVEDCWD, self.ns.fromfile)) as fp: for line in fp: + line = line.split('#', 1)[0] line = line.strip() - if line.startswith('#'): - continue - match = regex.match(line) - if match is None: - continue - self.tests.append(match.group(1)) + match = regex.search(line) + if match is not None: + self.tests.append(match.group(1)) removepy(self.tests) -- cgit v1.2.1 From 13a902781b28fb0216685c98ec48e8468cdea51b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 3 Jan 2017 01:38:58 +0100 Subject: Issue #29035: Simplify a regex in libregrtest regrtest: simplify the regex used to match test names for the --fromfile command line option. --- Lib/test/libregrtest/main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Lib/test/libregrtest/main.py') diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index e113ed63dd..61a9876370 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -179,17 +179,14 @@ class Regrtest: self.tests = [] # regex to match 'test_builtin' in line: # '0:00:00 [ 4/400] test_builtin -- test_dict took 1 sec' - regex = (r'(?:[0-9]+:[0-9]+:[0-9]+ *)?' - r'(?:\[[0-9/ ]+\] *)?' - r'(test_[a-zA-Z0-9_]+)\b(?:\.py)?') - regex = re.compile(regex) + regex = re.compile(r'\btest_[a-zA-Z0-9_]+\b') with open(os.path.join(support.SAVEDCWD, self.ns.fromfile)) as fp: for line in fp: line = line.split('#', 1)[0] line = line.strip() match = regex.search(line) if match is not None: - self.tests.append(match.group(1)) + self.tests.append(match.group()) removepy(self.tests) -- cgit v1.2.1 From 1b154e367502946cae598b9872f2f03dc64aa089 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 6 Feb 2017 12:42:00 +0100 Subject: regrtest: don't fail immediately if a child does crash Issue #29362: Catch a crash of a worker process as a normal failure and continue to run next tests. It allows to get the usual test summary: single line result (OK/FAIL), total duration, etc. --- Lib/test/libregrtest/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/libregrtest/main.py') diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 61a9876370..de1f4f9505 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -107,7 +107,7 @@ class Regrtest: self.test_times.append((test_time, test)) if ok == PASSED: self.good.append(test) - elif ok == FAILED: + elif ok in (FAILED, CHILD_ERROR): self.bad.append(test) elif ok == ENV_CHANGED: self.environment_changed.append(test) -- cgit v1.2.1