Skip to content

Commit 0f3c825

Browse files
authored
Merge branch 'main' into update
2 parents ad277aa + 1a64817 commit 0f3c825

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

test/single_line_runner.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ def clearline(stream):
1616

1717

1818
def term_width():
19-
return shutil.get_terminal_size()[0]
19+
return shutil.get_terminal_size().columns
2020

2121

2222
class SingleLineTestResult(ColorTextResult):
2323
"""Similar to the standard TextTestResult but uses ANSI escape codes
2424
for color output and reusing a single line on the terminal.
2525
"""
26-
max_status_msg = 20
26+
27+
# Reserve at least 20 columns for the status message
28+
min_status_msg = 20
29+
status_limit = None
2730

2831
def _write_status(self, _test, status):
2932
# Add some color to the status message
@@ -36,7 +39,7 @@ def _write_status(self, _test, status):
3639
status += '\n'
3740
else:
3841
color = CYAN
39-
status = status[:self.max_status_msg]
42+
status = status[:self.status_limit]
4043
line = f'{with_color(color, status)}'
4144
self.stream.write(line)
4245
self.stream.flush()
@@ -47,12 +50,17 @@ def startTest(self, test):
4750
self.showAll = True
4851
clearline(self.stream)
4952
prefix_len = self.writeProgressPrefix()
50-
max_desc = term_width() - prefix_len - len(' ... ') - self.max_status_msg
53+
total_width = term_width()
54+
max_desc = total_width - prefix_len - len(' ... ') - self.min_status_msg
5155
desc = str(test)[:max_desc]
5256
self.stream.write(desc)
5357
self.stream.write(' ... ')
5458
self.stream.flush()
5559

60+
# Calculate the remaining terminal width available for the _write_status
61+
# message. This will never be lower than `self.max_status_msg`
62+
self.status_limit = total_width - prefix_len - len(desc) - len(' ... ')
63+
5664
def printErrors(self):
5765
# All tests have been run at this point so print a final newline
5866
# to end out status line

test/test_browser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5671,9 +5671,11 @@ def test_rollup(self):
56715671
'es6': (['-sEXPORT_ES6', '--extern-post-js', test_file('modularize_post_js.js')], 9999),
56725672
})
56735673
def test_cross_origin(self, args, port):
5674-
# Verfies that the emscripten-generted JS and Wasm can be hosted on a different origin.
5675-
# This test create a second HTTP server running a different port that servers files from `subdir`.
5676-
# The main html is the servers from the normal 8888 server while the JS and Wasm are hosted
5674+
if '-sEXPORT_ES6' in args and browser_should_skip_feature('EMTEST_LACKS_ES6_WORKERS', Feature.WORKER_ES6_MODULES):
5675+
self.skipTest('This test requires a browser with ES6 Module Workers support')
5676+
# Verifies that the emscripten-generated JS and Wasm can be hosted on a different origin.
5677+
# This test creates a second HTTP server running on a different port that serves files from `subdir`.
5678+
# The main html is served from the normal port 8888 server while the JS and Wasm are hosted
56775679
# on the port specified above.
56785680
os.mkdir('subdir')
56795681
create_file('subdir/foo.txt', 'hello')

0 commit comments

Comments
 (0)