Skip to content

Commit 48bbae0

Browse files
committed
Merge branch 'mac-head' into topic/GR-14972-coverage
2 parents 71dcb1e + ddcef92 commit 48bbae0

File tree

86 files changed

+1651
-2355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1651
-2355
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def fun():
100100

101101
executable = sys.executable.split(" ") # HACK: our sys.executable on Java is a cmdline
102102
re_success = re.compile("(test\S+) \(([^\s]+)\) \.\.\. ok$", re.MULTILINE)
103+
re_failure = re.compile("(test\S+) \(([^\s]+)\) \.\.\. (?:ERROR|FAIL)$", re.MULTILINE)
103104
kwargs = {"stdout": subprocess.PIPE, "stderr": subprocess.PIPE, "text": True, "check": False}
104105

105106
glob_pattern = os.path.join(os.path.dirname(test.__file__), "test_*.py")
@@ -169,15 +170,15 @@ def fun():
169170
# we failed the first run, create a tag file with the passing
170171
# tests (if any)
171172
passing_tests = []
172-
173-
try:
174-
imported_test_module = __import__(testmod)
175-
except:
176-
imported_test_module = None
173+
failed_tests = []
177174

178175
def get_pass_name(funcname, classname):
179-
# try hard to get a most specific pattern
180-
if imported_test_module:
176+
try:
177+
imported_test_module = __import__(testmod)
178+
except:
179+
imported_test_module = None
180+
else:
181+
# try hard to get a most specific pattern
181182
classname = "".join(classname.rpartition(testmod)[1:])
182183
clazz = imported_test_module
183184
path_to_class = classname.split(".")[1:]
@@ -191,13 +192,24 @@ def get_pass_name(funcname, classname):
191192

192193
# n.b.: we add a '*' in the front, so that unittests doesn't add
193194
# its own asterisks, because now this is already a pattern
195+
196+
for funcname,classname in re_failure.findall(p.stdout):
197+
failed_tests.append("*" + get_pass_name(funcname, classname))
198+
for funcname,classname in re_failure.findall(p.stderr):
199+
failed_tests.append("*" + get_pass_name(funcname, classname))
200+
194201
for funcname,classname in re_success.findall(p.stdout):
195202
passing_tests.append("*" + get_pass_name(funcname, classname))
196203
for funcname,classname in re_success.findall(p.stderr):
197204
passing_tests.append("*" + get_pass_name(funcname, classname))
198205

206+
# n.b.: unittests uses the __qualname__ of the function as
207+
# pattern, which we're trying to do as well. however, sometimes
208+
# the same function is shared in multiple test classes, and
209+
# fails in some. so we always subtract the failed patterns from
210+
# the passed patterns
199211
with open(tagfile, "w") as f:
200-
for passing_test in passing_tests:
212+
for passing_test in set(passing_tests) - set(failed_tests):
201213
f.write(passing_test)
202214
f.write("\n")
203215
if not passing_tests:

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/doctest_aliases.txt

Whitespace-only changes.

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/sample_doctest_no_docstrings.txt

Whitespace-only changes.

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/sample_doctest_no_doctests.txt

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*wrapper
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test_decode
1+
*LegacyBase64TestCase.test_decode
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
test_b2a_base64_newline
2-
test_b2a_base64_newline
3-
test_b2a_base64_newline
1+
*BinASCIITest.test_b2a_base64_newline
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
test_backcompatibility
2-
test_keyword_args
3-
test_large_pyrange
4-
test_large_range
5-
test_negative_lo
6-
test_optionalSlicing
7-
test_precomputed
8-
test_random
9-
test_backcompatibility
10-
test_listDerived
11-
test_arg_parsing
12-
test_cmp_err
13-
test_get_only
14-
test_len_only
15-
test_non_sequence
16-
test_colors
17-
test_grades
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
test_blocked
2-
test_callable
3-
test_contains
4-
test_convert
5-
test_fileclosed
6-
test_float
1+
*BoolTest.test_blocked
2+
*BoolTest.test_callable
3+
*BoolTest.test_contains
4+
*BoolTest.test_convert
5+
*BoolTest.test_fileclosed
6+
*BoolTest.test_float

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_buffer.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)