mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-06 20:55:31 +02:00
feat(pty): add multithread support
Adds the option `use_threads` to PTY (enabled by default) which improves performance when enabled. For example, running `time cat file.txt` where file is ~4.5MB will take ~0.250s with threads enabled, versus >20s when disabled.
This commit is contained in:
parent
46f3aa12bf
commit
a0c9777264
3 changed files with 118 additions and 42 deletions
|
@ -1,4 +1,4 @@
|
|||
class_name UnixTest extends GutTest
|
||||
class_name NixTest extends GutTest
|
||||
|
||||
var pty: PTY
|
||||
var helper: Helper
|
||||
|
@ -112,6 +112,15 @@ func test_emits_exited_with_signal():
|
|||
assert_signal_emitted_with_parameters(pty, "exited", [0, PTY.SIGNAL_SIGSEGV])
|
||||
|
||||
|
||||
# Run the same tests, but with use_threads = false.
|
||||
class TestNoThreads:
|
||||
extends NixTest
|
||||
|
||||
func before_each():
|
||||
super.before_each()
|
||||
pty.use_threads = false
|
||||
|
||||
|
||||
class Helper:
|
||||
static func get_pts() -> Array:
|
||||
assert(false) #,"Abstract method")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue