Skip to content

Commit 4bc1eeb

Browse files
authored
Split up test other.test_standalone_system_headers to parallelize test runtime. (#25019)
Split up test other.test_standalone_system_headers to parallelize test runtime. It is still a slow test (> minute runtime), but much faster than before. Before: `Ran 1 test in 272.024s` After: `Total core time: 386.746s. Wallclock time: 64.692s. Parallelization: 5.98x.`
1 parent b31040d commit 4bc1eeb

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

test/test_other.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10069,7 +10069,23 @@ def test_multiple_o_files(self):
1006910069
# Tests that Emscripten-provided header files can be cleanly included standalone.
1007010070
# Also check they can be included in C code (where possible).
1007110071
@is_slow_test
10072-
def test_standalone_system_headers(self):
10072+
@parameterized({
10073+
'ab': ('ab',),
10074+
'cd': ('cd',),
10075+
'ef': ('ef',),
10076+
'gh': ('gh',),
10077+
'ij': ('ij',),
10078+
'kl': ('kl',),
10079+
'mn': ('mn',),
10080+
'op': ('op',),
10081+
'qr': ('qr',),
10082+
'st': ('st',),
10083+
'uv': ('uv',),
10084+
'wx': ('wx',),
10085+
'yz': ('yz',),
10086+
'other': ('*',),
10087+
})
10088+
def test_standalone_system_headers(self, prefix):
1007310089
# Test oldest C standard, and the default C standard
1007410090
# This also tests that each header file is self contained and includes
1007510091
# everything it needs.
@@ -10084,10 +10100,15 @@ def test_standalone_system_headers(self):
1008410100
directories[''].append(elem)
1008510101

1008610102
for directory, headers in directories.items():
10087-
print('dir: ' + directory)
1008810103
for header in headers:
1008910104
if not header.endswith('.h'):
1009010105
continue
10106+
# Process files depending on first char of the file in different test cases for parallelization, though
10107+
# special case SDL_ prefix to parallelize better.
10108+
first_char = (header[4] if header.startswith('SDL_') else header[0]).lower()
10109+
if first_char not in prefix or (prefix == '*' and first_char.isalpha()):
10110+
continue
10111+
1009110112
print('header: ' + header)
1009210113
# These headers cannot be included in isolation.
1009310114
# e.g: error: unknown type name 'EGLDisplay'

0 commit comments

Comments
 (0)